It is quite easy to use Amazon SES (Simple Email Service) with ColdFusion, just use CFMAIL tag and send mails out thought Amazon SMTP. Also bit more difficulty we can use SES API to do the same thing too. The biggest advantage, probably the only advantage of using the API instead SMTP call is API call returns the "message-id" assigned to our emails. This simple ID is immensely useful for tracking down emails if they bounces. And Amazon SNS (Simple Notification Service) make it quite easier to keep track of bounces with the "message-id". I might write another post about how to handle bounces and complains with SNS.
SES API have two mail send functions, SendEmail and SendRawEmail. SendEmail is the simplest and it only accepts plain texts emails with no attachments. SendRawEmail accept multipart emails, means Html, attachments, inline images, custom headers and everything bright and beautiful. But we have to manually create and format the Multipart email message before we send to SES API.
Here I put together two custom tags <CF_Mail> and <CF_Mailparam> to use with Amazon SES SendRawEmail call. These two tags tries to mimic our beloved CFMAIL and CFMAILPARAM tags, create multipart emails with attach files, inline images, html or plan and most importantly will returns the variable "MessageId" with the messag- ID of your email.
Use this like CFMAIL tag. MAIL tag supports from,to,cc,replyto,priority,type and Subject attributes just like CFMAIL, but default "Type" is HTML. Also there are two other attributes "Key" and "SecretKey" to hold your AWS credentials.
MAILPARAM tags tries to behave similar to CFMAILPARAM tag and it supports name,value,file,disposition and contentID attributes.
Show/Hide Line Numbers . Full Screen . Plain
Now here are the two custom tags: