Delphi Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CMFCDelphiFoxProJavaPerl
PHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

Delphi Examples

Bounced Mail
Bz2
Character Encoding
CSV
DKIM / DomainKey
Digital Certificates
Digital Signatures
DH Key Exchange
DSA
Email
Email Object
FTP
HTML Conversion
HTTP
IMAP
Encryption
MHT / HTML Email
NTLM
POP3
RSA
S/MIME
SMTP
Socket
Spider
SFTP
SSH
SSH Key
SSH Tunnel
String
Tar
Upload
XML
XMP
Zip Compression

More Examples...
Amazon S3
Byte Array
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
Bzip2
LZW

Type Conversion

 

Article: Understanding COM References in Delphi

Add Code to Send Mail

In the Delphi IDE, add the following code for the "Send Email" button:

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, OleCtrls, CHILKATMAILLib2_TLB;

type
  TForm1 = class(TForm)
    ChilkatMailMan21: TChilkatMailMan2;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
  email: IChilkatEmail2;
  ok: Integer;

begin
  ChilkatMailMan21.UnlockComponent('Anything for 30-day trial');
  ChilkatMailMan21.SmtpHost := 'smtp.comcast.net';

  email := ChilkatMailMan21.NewEmail();
  email.Subject := 'This is a test';
  email.From := 'Chilkat Support <support@chilkatsoft.com>';
  email.AddTo('John Doe','jdoe@someplace.com');
  email.Body := 'This is the body...';

  ok := ChilkatMailMan21.SendEmail(email);
  if (ok = 0) then
        ChilkatMailMan21.SaveLastError('errorLog.xml');
  
end;

end.

Go To Step4

Back To Step2

 

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

Mail Component · .NET Email Component · XML Parser