Email Address Formats - pzb/aws-ses GitHub Wiki

Most SES actions take one or more email addresses as parameters. There are several different formats an email address can have, and different actions require different formats.

The most basic format is a Mailbox. A Mailbox consists of a local part, an at sign ("@"), and a domain. For example, [email protected] is a valid mailbox. bob is the local part and example.com is the domain. The domain is case insensitive, so [email protected] and [email protected] are the same address. The domain can have the characters a-z, 0-9, and minus signs ("-") plus periods ("."). It may not start or end with a period and cannot have two or more consecutive periods. The local part is case sensitive so [email protected] and [email protected] are different addresses. While many mail servers choose to treat all the different case combinations as aliases of each other, one cannot depend on this functionality. The local part can contain the same characters as the domain plus any of !#$%&'*+/=^`_{|}~. Like the domain, the period cannot be the first or last character and cannot appear two or more times consecutively.

The second form for an email address is an angle address. This is simply a Mailbox prefixed by a less than ("<") and suffixed by a greater than (">"). For example, <[email protected]> is a valid angle address.

The third form for an email address is an address with display name. This allows one to associate a natural language name with the email address. In most cases, one simple prefixes an angle address with the name and a space. An example is Bob Williams <[email protected]>. The display name can contain the same characters as the local part of the email address except cannot contain a period. Characters not otherwise allowed can be included if the display name is surrounded by double quote characters. In a quoted display name a double quote or backslash must be escaped by prefixing the character with a backslash. "Robert A. Williams" <[email protected]> and "Williams, Bob" <[email protected]> and "Robert A. (\"Bob\") Williams" <[email protected]> are all valid addresses with quoted display names.

The official specifications do allow a few more things in email addresses, but this pretty much covers everything you should need to know to use SES.