Sample code for 30+ languages & platforms
Delphi DLL

SES Send Email using SMTP on Port 465 (TLS)

See more Amazon SES Examples

Demonstrates how to send SES email using the SMTP protocol with an implicit TLS connection on port 465.

Chilkat Delphi DLL Downloads

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

...

procedure TForm1.Button1Click(Sender: TObject);
var
success: Boolean;
mailman: HCkMailMan;
email: HCkEmail;

begin
success := False;

// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.

mailman := CkMailMan_Create();

// Use your SMTP endpoint from your Amazon SES --> SMTP Settings
CkMailMan_putSmtpHost(mailman,'email-smtp.us-west-2.amazonaws.com');

// You need Amazon SES SMTP credentials to access the SES SMTP interface.
// The credentials that you use to send email through the SES SMTP interface are unique to each AWS Region. 
// If you use the SES SMTP interface to send email in more than one Region, 
// you must generate a set of SMTP credentials for each Region that you plan to use.
// See SES SMTP Credentials

// Use your SMTP username and SMTP password for the SMTP credentials you created..
CkMailMan_putSmtpUsername(mailman,'AKIA54PBFR4HUHGCIZDS');
CkMailMan_putSmtpPassword(mailman,'BrVsadsAULqtHIaEBqx8Xsug073cGYc0PXBYcj17w4OW');

CkMailMan_putSmtpSsl(mailman,True);
CkMailMan_putSmtpPort(mailman,465);

// Create a new email object
email := CkEmail_Create();

CkEmail_putSubject(email,'This is a test');
CkEmail_putBody(email,'This is a test');
CkEmail_putFrom(email,'Chilkat Support <support@chilkatsoft.com>');
success := CkEmail_AddTo(email,'Chilkat Admin','admin@chilkatsoft.com');

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

success := CkMailMan_CloseSmtpConnection(mailman);
if (success <> True) then
  begin
    Memo1.Lines.Add('Connection to SMTP server not closed cleanly.');
  end;

Memo1.Lines.Add('Mail Sent!');

CkMailMan_Dispose(mailman);
CkEmail_Dispose(email);

end;