Amazon Simple Email Service Now Supports Attachments

There are no new “attachment” APIs. Instead, you simply use the existing SendRawEmail function to send a message that includes one or more MIME parts. Each part of the message must be of a MIME type that is supported by SES. Document and image formats are supported; executable files and archives are not. Consult the SES documentation for a complete list of supported MIME types.

Messages that include attachments incur an additional cost of $0.12 per GB of attachment data. This is in addition to the $0.10 cost for every 1000 messages and the usual cost for outbound data transfer (see the SES page for details).

I spent a few minutes putting together some PHP code to create and send a message with an attachment. I installed and configured the latest version of the AWS SDK for PHP, the Mail_Mime package, and wrote a little bit of code. Here’s what I ended up with:

As you can see, this is pretty straightforward. Per the usual operating protocol for SES, you’ll need to verify the email addresses that you use for testing, and you’ll need to request and receive production access in order to start sending to arbitrary addresses.