function SendMailViaAWSSES(aRegion: TSESEndpoint; aAPIKey, aAPISecret, mFrom, mTo, mSubj, mText, mAtt: string; var aErr: string): boolean;

This function sends an email to a destination email address using AWS' SES (Simple Email Service). Optionally you can attach one file to the message you're sending.
 
Parameters

aRegion

The AWS SES region, as defined in/ny the following set  TSESEndpoint = (sesUSEast, sesUSWest, sesEU);

aAPIKey

The API key you generated for the SES service in your AWS subscription

aAPISecret

The API Secret you generated for the SES service in your AWS subscription

mTo

The email address of the recipient

mSubj

The subject of your email message

mText

The contents (text) of your email message

mAtt

The full path to a file you want to attach. This is optional, in order not to attach any file, just pass an empty string.

aErr

A variable that will receive an error message (in case the function fails and returns 'false'

 
Return value

True

The message was sent successfully

False

Error while sending message; the message was not sent, the the value of the aErr variable for further information

 
Remarks
This function could take a very long time to execute depending on the size of the file(s) you are trying to send via email. Please take that into account before using this function in your script. A wise habit is to always check the original file size before attaching it to an email message. This can be done using the FileSize function.

Example


// The following example sends an email to a recipient using AWS SES
var
  lErr: string;
begin
  SendMailViaAWSSES(sesUSWest, 'faywfyw372t73', '8i34frw378f7843w', 'myemail@me.com', 'recipien@you.com', 'Some subject', 'Email contents', 'C:\Dox\Attach.pdf', lErr);
end.