DataFlex
DataFlex
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 DataFlex Downloads
Use ChilkatAx-win32.pkg
Procedure Test
Boolean iSuccess
Handle hoMailman
Variant vEmail
Handle hoEmail
String sTemp1
Move False To iSuccess
// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
Get Create (RefClass(cComChilkatMailMan)) To hoMailman
If (Not(IsComObjectCreated(hoMailman))) Begin
Send CreateComObject of hoMailman
End
// Use your SMTP endpoint from your Amazon SES --> SMTP Settings
Set ComSmtpHost Of hoMailman To "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..
Set ComSmtpUsername Of hoMailman To "AKIA54PBFR4HUHGCIZDS"
Set ComSmtpPassword Of hoMailman To "BrVsadsAULqtHIaEBqx8Xsug073cGYc0PXBYcj17w4OW"
Set ComSmtpSsl Of hoMailman To True
Set ComSmtpPort Of hoMailman To 465
// Create a new email object
Get Create (RefClass(cComChilkatEmail)) To hoEmail
If (Not(IsComObjectCreated(hoEmail))) Begin
Send CreateComObject of hoEmail
End
Set ComSubject Of hoEmail To "This is a test"
Set ComBody Of hoEmail To "This is a test"
Set ComFrom Of hoEmail To "Chilkat Support <support@chilkatsoft.com>"
Get ComAddTo Of hoEmail "Chilkat Admin" "admin@chilkatsoft.com" To iSuccess
Get pvComObject of hoEmail to vEmail
Get ComSendEmail Of hoMailman vEmail To iSuccess
If (iSuccess <> True) Begin
Get ComLastErrorText Of hoMailman To sTemp1
Showln sTemp1
Procedure_Return
End
Get ComCloseSmtpConnection Of hoMailman To iSuccess
If (iSuccess <> True) Begin
Showln "Connection to SMTP server not closed cleanly."
End
Showln "Mail Sent!"
End_Procedure