Internet Mail - pzb/aws-ses GitHub Wiki

In order to understand how to use SES, developers need some background on Internet Mail. Unfortunately the SES documentation tends to get it wrong. There is not a single document that is the official standard for internet mail. There are multiple documents that describe the standards for different parts of the internet mail system.

Internet email contains three parts: an envelope, header, and the content of the message.

The Simple Mail Transport Protocol is the standard that defines how to transfer messages between servers. This is conceptually the same as the system your regular mail uses to get from you to your grandmother a few states away. The only important part at this stage is the envelope. The SMTP envelope gives instructions on handling the message. In the most basic form, it contains the address of the recipient and a return address, which tells where to return the message if it is undeliverable. A more complex envelope might also include information about the size of the message, identification of the sender of the message, instructions on limitations for transporting the message, and requirements on delivery. Today SES only implements the return address and the recipient portions of the envelope.

The Internet Message Format defines the layout of a message. This is conceptually the same as defining the format for a letter; if you went to school in the US, you may have learned about "full block" and "modified" formats. A business letter usually has information at the top indicating the sender, the recipients, subjects, references to prior letters, and similar items. In the Internet Message Format these are all called "headers". Headers contain information about the message but not the message itself. Each header has a name, a colon (:), then the information. For example, "Subject: Overdraft protection for your account".

Finally the message content itself can either be simple text or it can be in what is a called MIME format. Multipurpose Internet Mail Extensions is a standard that allows a single message to contain multiple items. Think of the difference between a simple sheet of paper with typewritten text and a cardboard box. Both can go through the post office, but they can contain very different things.

Amazon SES gives you two ways to send mail. In the first case, you give SES all the parts and it assembles the mail for you. This is similar to using a shipping service like The UPS Store or Fedex Office to prepare the shipment for you. In the second case, you get everything ready and pass the prepared mail to SES to send. This is the same as dropping your mail into the mailbox for the postman to pickup.

Sending email via Amazon SES requires using their programming interface. Please see SES API for details about the programming interface and how to send mail using SES.