Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

EMail Client 1

Status
Not open for further replies.

wasis

Programmer
Sep 10, 2008
2
ID
I want to make email client for gmail, anyone know how ?
thanks
 
whosrdaddy, I'm also interested in this topic but do I need to pay to be able to view the topic in Experts Exchange?

www.radbmx.co.uk
 
no, but you must register an account on their site.

/Daddy

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
for those without an account, I pasted the solution's code here :

Code:
Jacco:I got it :-)

You have to do a lot correctly though. Here are the steps:

1. Start a new Delphi project (I used Delphi 7 with Indy 10)

2. You have to download the SSL dlls from this site:

[URL unfurl="true"]http://indy.fulgan.com/SSL/indy_OpenSSL096m.zip[/URL]

3. Unzip the file and put libeay32.dll and ssleay32.dll in your projects path.

4. Replace the code of Unit1.pas and Unit1.dfm with the code below

5. Change the Username and Password properties on the POP3 component to match those of your GMAIL account.

6. Run and it will show you one message of the GMAIL account

(Doesn't work? Then the settings of you gmail account are probably incorrect. I have set them to "Enable POP for all mail (even mail that's already been downloaded)" "Keep GMail's copy in the inbox")

The hartdest part of getting this to work was getting the utUseImplicitTLS of to POP3 component.

Good luck.

Regards Jacco

<<<StartOfCode>>>
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, IdBaseComponent, IdComponent, IdTCPConnection,
  IdTCPClient, IdExplicitTLSClientServerBase, IdMessageClient, IdPOP3,
  IdIOHandler, IdIOHandlerSocket, IdIOHandlerStack, IdSSL, IdSSLOpenSSL;

type
  TForm1 = class(TForm)
    POP3: TIdPOP3;
    Button1: TButton;
    SSLHandler: TIdSSLIOHandlerSocketOpenSSL;
    Memo1: TMemo;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

uses
  IdMessage, IdText;

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
  lMsg: TIdMessage;
  liCount: Integer;
  liMessages: Integer;
begin
  POP3.Connect;
  liMessages := POP3.CheckMessages;
  Memo1.Lines.Add('CheckMessages: ' + IntToSTr(liMessages));
  lMsg := TIdMessage.Create;
  try
    POP3.Retrieve(1, lMsg);
    Memo1.Lines.Text := lMsg.MsgId;
    for liCount := 0 to lMsg.MessageParts.Count-1 do
      if lMsg.MessageParts[liCount] is TIdText then
        Memo1.Lines.AddStrings((lMsg.MessageParts[liCount] as TIdText).Body);
  finally
    lMsg.Free;
  end;
end;

end.
<<<EndOfCode>>>
<<<StartOfDFM>>>
object Form1: TForm1
  Left = 192
  Top = 114
  Width = 696
  Height = 480
  Caption = 'Form1'
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = False
  PixelsPerInch = 96
  TextHeight = 13
  object Button1: TButton
    Left = 216
    Top = 16
    Width = 75
    Height = 25
    Caption = 'Button1'
    TabOrder = 0
    OnClick = Button1Click
  end
  object Memo1: TMemo
    Left = 24
    Top = 56
    Width = 657
    Height = 185
    Lines.Strings = (
      'Memo1')
    TabOrder = 1
  end
  object POP3: TIdPOP3
    IOHandler = SSLHandler
    AutoLogin = True
    Host = 'pop.gmail.com'
    Username = 'YourName@gmail.com'
    UseTLS = utUseImplicitTLS
    Password = 'YourPassword'
    Port = 995
    SASLMechanisms = <>
    Left = 40
    Top = 16
  end
  object SSLHandler: TIdSSLIOHandlerSocketOpenSSL
    Destination = 'pop.gmail.com:995'
    Host = 'pop.gmail.com'
    MaxLineAction = maException
    Port = 995
    DefaultPort = 0
    SSLOptions.Method = sslvSSLv2
    SSLOptions.Mode = sslmUnassigned
    SSLOptions.VerifyMode = []
    SSLOptions.VerifyDepth = 0
    Left = 80
    Top = 16
  end
end
<<<EndOfDFM>>>

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
LucieLastic said:
I'm also interested in this topic but do I need to pay to be able to view the topic in Experts Exchange?
If you're sneaky, find the EE page using Google. Then look at Google's cached page. Scroll down the page and all the hidden stuff shows up at the bottom. :)
 
Thank You, But In order to complete it, I need to know how to send an email via SMTP, and I want to make a splitter in my program like those of Thunderbird or Outlook.

I have tried to use splitter tool, but I don't know how to use it.

Do you know ?
Thanks for any reply.
 
For a splitter to work, you must set it up in the initial form creation in the IDE, and in the correct order. It is difficult to insert splitters into an existing form that already has several visual components.

For a horizontal splitter:
[ol]
[li]Drop a TPanel on a blank form.[/li]
[li]Set its align property to alTop.[/li]
[li]Drop a TSplitter on the form (not the panel).[/li]
[li]Set its align property to alTop.[/li]
[li]Drop another TPanel near the bottom of the form.[/li]
[li]Set its align property to alClient.[/li]
[li]Run it to verify it works.[/li]
[li]Optionally, save it to the repository as a template.[/li]
[li]Add your visual components to the appropriate panels.[/li]
[/ol]
You can also nest additional split panels within the two panels you've created.
Good luck!


Roo
Delphi Rules!
 
Like other email client with handlers,butshould filter only gmail addres.You have one good example on marcu cantu web site for mastering delphi 6 book.Also you can buy this book.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top