Chilkat Examples

ChilkatHOMEAndroid™Classic ASPCC++C#Mono C#.NET Core C#C# UWP/WinRTDataFlexDelphi ActiveXDelphi DLLVisual FoxProJavaLianjaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerBuilderPowerShellPureBasicCkPythonChilkat2-PythonRubySQL ServerSwift 2Swift 3/4TclUnicode CUnicode C++Visual Basic 6.0VB.NETVB.NET UWP/WinRTVBScriptXojo PluginNode.jsExcelGo

Delphi DLL Examples

Web API Categories

ASN.1
Amazon Glacier
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Async
Azure Cloud Storage
Azure Service Bus
Base64
Bounced Email
Box
CSR
CSV
Certificates
Compression
DKIM / DomainKey
DSA
Diffie-Hellman
Digital Signatures
Dropbox
Dynamics CRM
ECC
Email Object
Encryption
FTP
FileAccess
Firebase
GMail REST API
Geolocation
Google APIs
Google Calendar
Google Cloud Storage
Google Drive
Google Photos
Google Sheets
Google Tasks
Gzip
HTML-to-XML/Text

HTTP
HTTP Misc
IMAP
JSON
JSON Web Encryption (JWE)
JSON Web Signatures (JWS)
JSON Web Token (JWT)
Java KeyStore (JKS)
MHT / HTML Email
MIME
Microsoft Graph
NTLM
OAuth1
OAuth2
OneDrive
OpenSSL
Outlook
PEM
PFX/P12
POP3
PRNG
REST
REST Misc
RSA Encryption
SCP
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
SharePoint
Socket/SSL/TLS
Spider
Stream
Tar Archive
Upload
WebSocket
XAdES
XML
XML Digital Signatures
XMP
Zip
curl

 

 

 

(Delphi DLL) POP3 Session Log

Demonstrates how the Chilkat email component keeps a log of the current POP3 session in the mailman.Pop3SessionLog property.

Chilkat for Delphi Downloads

Chilkat non-ActiveX DLL for Delphi

Chilkat ActiveX DLL for Delphi

* The examples here use the non-ActiveX DLL.

uses
    Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
    Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, MailMan, StringArray;

...

procedure TForm1.Button1Click(Sender: TObject);
var
mailman: HCkMailMan;
success: Boolean;
sa: HCkStringArray;
i: Integer;
n: Integer;

begin
//  The mailman object is used for receiving (POP3)
//  and sending (SMTP) email.
mailman := CkMailMan_Create();

//  Any string argument automatically begins the 30-day trial.
success := CkMailMan_UnlockComponent(mailman,'30-day trial');
if (success <> True) then
  begin
    Memo1.Lines.Add('Component unlock failed');
    Exit;
  end;

//  Set the POP3 server's hostname
CkMailMan_putMailHost(mailman,'pop.someMailServer.com');

//  Set the POP3 login/password.
CkMailMan_putPopUsername(mailman,'matt@chilkatsoft.com');
CkMailMan_putPopPassword(mailman,'****');

//  You may explicitly begin and end POP3 sessions by calling
//  Pop3BeginSession and Pop3EndSession.  However,
//  if a method is called that requires a connection to the POP3
//  server, the connection and session will become established
//  automatically.  Therefore, it is not required to explicitly call
//  Pop3BeginSession and Pop3EndSession.

success := CkMailMan_Pop3BeginSession(mailman);
if (success <> True) then
  begin
    Memo1.Lines.Add(CkMailMan__lastErrorText(mailman));
    Exit;
  end;

//  Get a list of the UIDLs for the email in the mailbox and print it.
sa := CkMailMan_GetUidls(mailman);

n := CkStringArray_getCount(sa);

for i := 0 to n - 1 do
  begin
    Memo1.Lines.Add(CkStringArray__getString(sa,i));
  end;

CkStringArray_Dispose(sa);

//  Display the POP3 session log:
Memo1.Lines.Add(CkMailMan__pop3SessionLog(mailman));

success := CkMailMan_Pop3EndSession(mailman);
if (success <> True) then
  begin
    Memo1.Lines.Add(CkMailMan__lastErrorText(mailman));
    Exit;
  end;

CkMailMan_Dispose(mailman);

end;

 

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