Delphi Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

Delphi Examples

Bounced Mail
Character Encoding
Digital Certificates
Digital Signatures
Email
FTP
HTML-to-XML
HTTP
IMAP
Encryption
MHT / HTML Email
RSA Encryption
S/MIME
Socket
Spider
String
Tar
Upload
XML
XMP
Zip Compression

More Examples...
Byte Array
Email Object
POP3
SMTP
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
DH Key Exchange
DSA
SSH Key
SSH
SSH Tunnel
SFTP

Unreleased...
Bzip2
LZW
Bz2
Icon

Type Conversion

 

Article: Understanding COM References in Delphi

Read POP3 Email with Progress Monitoring Event Callbacks

Download Chilkat Email ActiveX

Delphi programming example showing how to read a POP3 mailbox with progress monitoring.

// Delphi created this method for us, and we simply added the one line
// of code in the method body.  To generate the event callback procedure,
// click on the ChilkatMailMan2 object on your Form.  Then click on the
// "Events" tab (which is to the right of the Properties tab) and finally
// double-click on the blank dropdown for OnReadPercentDone.
procedure TForm1.ChilkatMailMan21ReadPercentDone(ASender: TObject;
  percentDone: Integer; out abort: Integer);
begin
  ProgressBar1.Position := percentDone;
end;

// Read email from a POP3 server with progress monitoring.
procedure TForm1.Button2Click(Sender: TObject);
var
  email: IChilkatEmail2;
  bundle: IChilkatEmailBundle2;
  n: Integer;
  i: Integer;

begin
  // A ChilkatMailMan2 ActiveX component was dropped onto the Delphi
  // form, and this became the Form's member variable "ChilkatMailMan21".

  // Unlock the component -- only needs to be called once in a program.
  ChilkatMailMan21.UnlockComponent('Anything for 30-day trial');

  // Set the POP3 mail server hostname, login, and password.
  ChilkatMailMan21.MailHost := 'mail.chilkatsoft.com';
  ChilkatMailMan21.PopUsername := '****';
  ChilkatMailMan21.PopPassword := '****';

  // Read the entire mailbox, leaving the mail on the POP3 server.
  bundle := ChilkatMailMan21.CopyMail();
  if (bundle = nil) then
      ShowMessage(ChilkatMailMan21.LastErrorText);

  // Loop over the emails in the bundle and add the From address
  // and Subject to a list box.
  n := bundle.MessageCount;
  for i := 0 to n-1 do begin
      email := bundle.GetEmail(i);
      ListBox1.Items.Add(email.From);
      ListBox1.Items.Add(email.Subject);
      ListBox1.Items.Add('----');
  end;


end;

 

 

Need a specific example? Send a request to support@chilkatsoft.com

© 2000-2008 Chilkat Software, Inc. All Rights Reserved.

Mail Component · .NET Email Component · XML Parser