Simple Email Service - Developer Guide
Simple Email Service - Developer Guide
Simple Email Service - Developer Guide
Developer Guide
API Version 2010-12-01
Table of Contents
What Is Amazon SES? .................................................................................................................. 1
Why use Amazon SES? ........................................................................................................ 1
Amazon SES and other AWS services ..................................................................................... 1
In this guide ......................................................................................................................... 2
Sending Email .............................................................................................................................. 3
How do I send emails using Amazon SES? .............................................................................. 3
How do I start? .................................................................................................................... 4
Concepts ............................................................................................................................. 5
Amazon SES and Deliverability ....................................................................................... 6
Email-Sending Process .................................................................................................. 9
Email Format and Amazon SES .................................................................................... 12
Quick Start ......................................................................................................................... 15
Step 1: Sign up for AWS .............................................................................................. 15
Step 2: Verify your email address .................................................................................. 15
Step 3: Send your first email ........................................................................................ 15
Step 4: Consider how you will handle bounces and complaints ........................................... 16
Step 5: Move out of the Amazon SES sandbox ............................................................... 16
Next steps .................................................................................................................. 16
Getting Started ................................................................................................................... 16
Using the Amazon SES Console ................................................................................... 16
Using Simple Mail Transfer Protocol (SMTP) ................................................................... 17
Using an AWS SDK .................................................................................................... 17
Before You Begin ........................................................................................................ 17
Send an Email Using the Console ................................................................................. 17
Send an Email Using SMTP ......................................................................................... 19
Send an Email Using an AWS SDK ............................................................................... 28
Setting up Email ................................................................................................................. 37
Signing up for AWS ..................................................................................................... 38
Verifying Email Addresses and Domains ......................................................................... 39
Getting Your AWS Access Keys .................................................................................... 46
Downloading an AWS SDK .......................................................................................... 46
Using a Custom MAIL FROM Domain ............................................................................ 46
Setting up SPF Records ............................................................................................... 53
Getting Your SMTP Credentials ..................................................................................... 54
Moving Out of the Sandbox .......................................................................................... 54
Sending Your Email ............................................................................................................. 55
Using the SMTP Interface ............................................................................................ 56
Using the API ............................................................................................................. 87
Authenticating Your Email .................................................................................................... 92
Authenticating Email with SPF ...................................................................................... 92
Authenticating Email with DKIM ..................................................................................... 93
Complying with DMARC ............................................................................................. 103
Monitoring Your Sending Activity .......................................................................................... 103
Monitoring Using the Console or API ............................................................................ 105
Monitoring Using Notifications ...................................................................................... 106
Monitoring Using Event Publishing ............................................................................... 127
Managing Your Sending Limits ............................................................................................ 192
Monitoring Your Sending Limits ................................................................................... 193
Increasing Your Sending Limits ................................................................................... 194
What Happens When You Reach Your Sending Limits .................................................... 195
Using Sending Authorization ............................................................................................... 196
Overview of Sending Authorization ............................................................................... 197
Sending Authorization Policies ..................................................................................... 199
Sending Authorization Policy Examples ......................................................................... 203
Identity Owner Tasks ................................................................................................. 207
API Version 2010-12-01
iv
213
219
219
219
220
222
224
226
226
227
227
227
228
228
229
229
230
231
231
233
235
236
236
237
238
240
242
245
257
259
259
259
260
261
261
261
262
265
269
269
273
273
273
275
276
276
278
279
279
290
291
293
295
296
297
307
307
308
Welcome to the Amazon Simple Email Service (Amazon SES) Developer Guide. Amazon SES is an
email platform that provides an easy, cost-effective way for you to send and receive email using your
own email addresses and domains.
For example, you can send marketing emails such as special offers, transactional emails such as order
confirmations, and other types of correspondence such as newsletters. When you use Amazon SES
to receive mail, you can develop software solutions such as email autoresponders, email unsubscribe
systems, and applications that generate customer support tickets from incoming emails.
You only pay for what you use, so you can send and receive as much or as little email as you like. For
service highlights, FAQs, and pricing information, go to the Amazon SES Detail Page.
Use the AWS Management Console to set up Easy DKIM, which is a way to authenticate your
emails. Although you can use Easy DKIM with any DNS provider, it is especially easy to set up when
you manage your domain with Amazon Route 53.
Control user access to your email sending by using AWS Identity and Access Management (IAM).
Store emails you receive in Amazon Simple Storage Service (Amazon S3).
Take action on your received emails by triggering AWS Lambda functions.
Use AWS Key Management Service (AWS KMS) to optionally encrypt the mail you receive in your
Amazon S3 bucket.
Use AWS CloudTrail to log Amazon SES API calls that you make using the console or the Amazon
SES API.
Publish your email sending events to Amazon CloudWatch or Amazon Kinesis Firehose. If you
publish your email sending events to Firehose, you can access them in Amazon Redshift, Amazon
Elasticsearch Service, or Amazon S3.
In this guide
This guide contains the following sections:
Section
Description
Lists the Amazon SES SMTP and API endpoints for the
AWS regions in which Amazon SES is available, and
contains information you need to know when you use
Amazon SES endpoints in multiple regions.
Lists resources that you may find useful as you work with
Amazon SES
For technical discussions about various Amazon SES topics, visit the Amazon SES Blog. To browse
and post questions, go to the Amazon SES Forum.
When you use Amazon SES, Amazon SES becomes your outbound email server. You can also keep
your existing email server and configure it to send your outgoing emails through Amazon SES so
that you don't have to change any settings in your email clients. The following diagram shows where
Amazon SES fits in to the email sending process.
A sender can generate the email content in different ways. A sender can create the email by using an
email client application, or use a program that automatically generates emails, like an application that
sends order confirmations in response to purchase transactions.
primarily to monitor your sending activity. For example, you can quickly view the number of emails
that you have sent and the number of bounces and complaints that you have received.
SMTP InterfaceThere are two ways to access Amazon SES through the SMTP interface. The first
way, which requires no coding, is to configure any SMTP-enabled software to send email through
Amazon SES. For example, you can configure your existing email client or software program to
connect to the Amazon SES SMTP endpoint instead of your current outbound email server.
The second way is to use an SMTP-compatible programming language such as Java and access the
Amazon SES SMTP interface by using the language's built-in SMTP functions and data types.
Amazon SES APIYou can call the Amazon SES Query API directly through HTTPS, or you can
use the AWS Command Line Interface, the AWS Tools for Windows PowerShell, or an AWS SDK.
The AWS SDKs wrap the low-level functionality of the Amazon SES API with higher-level data types
and function calls that take care of the details for you. The AWS SDKs provide not only Amazon SES
operations, but also basic AWS functionality such as request authentication, request retries, and
error handling.
How do I start?
If you are a first-time user of Amazon SES, we recommend that you begin by reading the following
sections:
Amazon SES Quick Start (p. 15)Shows you how to get set up and send a test email as quickly
as possible.
Getting Started Sending Email with Amazon SES (p. 16)Shows you how to send an email by
using the Amazon SES console, the SMTP interface, and an AWS SDK. Examples are provided in
C#, Java, and PHP.
Amazon SES and Deliverability (p. 6)Explains email deliverability concepts that you should be
familiar with when you use Amazon SES.
Amazon SES Email-Sending Process (p. 9)Shows you what happens when you send an email
through Amazon SES.
Email Format and Amazon SES (p. 12)Reviews the format of emails and identifies the
information that you need to provide to Amazon SES.
Then you can learn about sending email with Amazon SES in more detail by reading the sections listed
in the following table:
Section
Description
Shows you how to sign up for AWS, get your AWS access
keys, download an AWS SDK, verify email addresses or
domains, and move out of the Amazon SES sandbox.
Section
Description
Using Dedicated IP
Addresses (p. 219)
For technical discussions about various Amazon SES topics, visit the Amazon SES Blog. To browse
and post questions, go to the Amazon SES Forum.
For technical discussions about various Amazon SES topics, visit the Amazon SES Blog. To browse
and post questions, go to the Amazon SES Forum.
API Version 2010-12-01
5
Bounce
If your recipient's receiver (for example, an ISP) fails to deliver your message to the recipient, the
receiver bounces the message back to Amazon SES. Amazon SES then notifies you of the bounced
API Version 2010-12-01
6
email through email or through Amazon Simple Notification Service (Amazon SNS), depending
on how you have your system set up. For more information, see Monitoring Using Amazon SES
Notifications (p. 106).
There are hard bounces and soft bounces, as follows:
Hard bounce A persistent email delivery failure. For example, the mailbox does not exist.
Amazon SES does not retry hard bounces, with the exception of DNS lookup failures. We strongly
recommend that you do not make repeated delivery attempts to email addresses that hard bounce.
Soft bounce A temporary email delivery failure. For example, the mailbox is full, there are too
many connections (also called throttling), or the connection times out. Amazon SES retries soft
bounces multiple times. If the email still cannot be delivered, then Amazon SES stops retrying it.
Amazon SES notifies you of hard bounces and soft bounces that will no longer be retried. However,
only hard bounces count toward your bounce rate and the bounce metric that you retrieve using the
Amazon SES console or the GetSendStatistics API.
Bounces can also be synchronous or asynchronous. A synchronous bounce occurs while the email
servers of the sender and receiver are actively communicating. An asynchronous bounce occurs when
a receiver initially accepts an email message for delivery and then subsequently fails to deliver it to the
recipient.
Complaint
Most email client programs provide a button labeled "Mark as Spam," or similar, which moves the
message to a spam folder, and forwards it to the ISP. Additionally, most ISPs maintain an abuse
address (e.g., [email protected]), where users can forward unwanted email messages and request
that the ISP take action to prevent them. In both of these cases, the recipient is making a complaint.
If the ISP concludes that you are a spammer, and Amazon SES has a feedback loop set up with the
ISP, then the ISP will send the complaint back to Amazon SES. When Amazon SES receives such a
complaint, it forwards the complaint to you either by email or by using an Amazon SNS notification,
depending on how you have your system set up. For more information, see Monitoring Using Amazon
SES Notifications (p. 106). We recommend that you do not make repeated delivery attempts to email
addresses that generate complaints.
Suppression List
The Amazon SES suppression list is a list of recipient email addresses that have recently caused a
hard bounce for any Amazon SES customer. If you try to send an email through Amazon SES to an
address that is on the suppression list, the call to Amazon SES succeeds, but Amazon SES treats
the email as a hard bounce instead of attempting to send it. Like any hard bounce, suppression list
bounces count towards your sending quota and your bounce rate. An email address can remain on the
suppression list for up to 14 days. If you are sure that the email address that you're trying to send to
is valid, you can submit a suppression list removal request. For more information, see Removing an
Email Address from the Amazon SES Suppression List (p. 236).
Be Proactive
One of the biggest issues with email on the Internet is unsolicited bulk email, or spam. ISPs take
considerable measures to prevent their customers from receiving spam. Correspondingly, Amazon
SES takes proactive steps to decrease the likelihood that ISPs consider your email to be spam.
Amazon SES uses verification, authentication, sending limits, and content filtering. Amazon SES also
maintains a trusted reputation with ISPs and requires you to send high-quality email. Amazon SES
does some of those things for you automatically (like content filtering); in other cases, it provides the
tools (like authentication), or guides you in the right direction (sending limits). The following sections
provide more information about each concept.
API Version 2010-12-01
7
Verification
Unfortunately, it's possible for a spammer to falsify an email header and spoof the originating email
address so that it appears as though the email originated from a different source. To maintain trust
between ISPs and Amazon SES, Amazon SES needs to ensure that its senders are who they
say they are. You are therefore required to verify all email addresses from which you send emails
through Amazon SES to protect your sending identity. You can verify email addresses by using the
Amazon SES console or by using the Amazon SES API. You can also verify entire domains. For
more information, see Verifying Email Addresses in Amazon SES (p. 39) and Verifying Domains in
Amazon SES (p. 41).
If your account is still in the Amazon SES sandbox, you also need to verify all recipient addresses
except for addresses provided by the Amazon SES mailbox simulator. For information about getting
out of the sandbox, see Moving Out of the Amazon SES Sandbox (p. 54). For more information
about the mailbox simulator, see Testing Amazon SES Email Sending (p. 224).
Authentication
Authentication is another way that you can indicate to ISPs that you are who you say you are. When
you authenticate an email, you provide evidence that you are the owner of the account and that
your emails have not been modified in transit. In some cases, ISPs refuse to forward email that is
not authenticated. Amazon SES supports two methods of authentication: Sender Policy Framework
(SPF) and DomainKeys Identified Mail (DKIM). For more information, see Authenticating Your Email in
Amazon SES (p. 92).
Sending Limits
If an ISP detects sudden, unexpected spikes in the volume or rate of your emails, the ISP might
suspect you are a spammer and block your emails. Therefore, every Amazon SES account has a set
of sending limits to regulate the number of email messages that you can send and the rate at which
you can send them. These sending limits help you to gradually ramp up your sending activity to protect
your trustworthiness with ISPs.
Amazon SES has two sending limits: a sending quota (the maximum number of messages you can
send in a 24-hour period) and a maximum send rate (the maximum number of emails that Amazon
SES can accept from your account per second, although the actual rate at which Amazon SES accepts
your messages might be less than the maximum send rate). If you are a brand-new user, Amazon SES
lets you send a small amount of email each day. If the mail that you send is acceptable to ISPs, this
limit will gradually increase. Over time, your sending limits will steadily increase so that you can send
larger quantities of email at faster rates. You can also file an SES Sending Limits Increase case to get
your quotas increased if you need them to ramp up more quickly.
For more information about sending limits and how to increase them, see Managing Your Amazon SES
Sending Limits (p. 192).
Content Filtering
Many ISPs use content filtering to determine if incoming emails are spam. Content filters look for
questionable content and block the email if the email fits the profile of spam. Amazon SES uses
content filters also. When your application sends a request to Amazon SES, Amazon SES assembles
an email message on your behalf and then scans the message header and body to determine if they
contain content that ISPs might construe as spam. If your messages look like spam to the content
filters that Amazon SES uses, your reputation with Amazon SES will be negatively affected. If a
message is infected with a virus, it is rejected by Amazon SES entirely.
Reputation
When it comes to email sending, reputationa measure of confidence that an IP address, email
address, or sending domain is not the source of spamis important. Amazon SES maintains a strong
reputation with ISPs so that ISPs deliver your emails to your recipients' inboxes. Similarly, you need
API Version 2010-12-01
8
to maintain a trusted reputation with Amazon SES. You build your reputation with Amazon SES by
sending high-quality content. When you send high-quality content, your reputation becomes more
trusted over time and Amazon SES increases your sending limits. Excessive bounces and complaints
negatively impact your reputation and can cause Amazon SES to lower your sending limits or terminate
your Amazon SES account.
One way to help maintain your reputation is to use the mailbox simulator when you test your system,
instead of sending to email addresses that you have created yourself. Emails to the mailbox simulator
do not count toward your bounce and complaint metrics. For more information about the mailbox
simulator, see Testing Amazon SES Email Sending (p. 224).
High-Quality Email
High-quality email is email that recipients find valuable and want to receive. Value means different
things to different recipients and can come in the form of offers, order confirmations, receipts,
newsletters, etc. Ultimately, your deliverability rests on the quality of the emails that you send because
ISPs block emails that they find to be low quality (spam). For more information about how to send highquality email, see Improving Deliverability with Amazon SES (p. 227) and the Amazon Simple Email
Service Email Sending Best Practices whitepaper.
Stay Informed
Whether your deliveries fail, your recipients complain about your emails, or Amazon SES successfully
delivers an email to a recipient's mail server, Amazon SES helps you to track down the issue by
providing notifications and by enabling you to easily monitor your usage statistics.
Notifications
When an email bounces, the ISP notifies Amazon SES, and Amazon SES notifies you. Amazon SES
notifies you of hard bounces and soft bounces that Amazon SES will no longer retry. Many ISPs also
forward complaints, and Amazon SES sets up complaint feedback loops with the major ISPs so you
don't have to. Amazon SES can notify you of bounces, complaints, and successful deliveries in two
ways: you can set your account up to receive notifications through Amazon SNS, or you can receive
notifications by email (bounces and complaints only). For more information, see Monitoring Using
Amazon SES Notifications (p. 106).
Usage Statistics
Amazon SES provides usage statistics so that you can view your failed deliveries to determine and
resolve the root causes. You can view your usage statistics by using the Amazon SES console or by
calling the Amazon SES API. You can view how many deliveries, bounces, complaints, and virusinfected rejected emails you have, and you can also view your sending limits to ensure that you stay
within them.
1.
A client application, acting as an email sender, makes a request to Amazon SES to send email to
one or more recipients.
2.
If the request is valid, Amazon SES accepts the email and sends it over the Internet to the
recipient's receiver. Once the message is passed to Amazon SES, it is usually sent immediately,
with the first delivery attempt normally occurring within milliseconds.
3.
The following sections review the individual possible outcomes after a sender sends an email request
to Amazon SES and after Amazon SES sends an email message to the recipient.
Note
If Amazon SES successfully accepts the sender's request and then an Amazon SES content
filter finds that the message contains a virus, Amazon SES drops the message and notifies
the sender by email.
The method through which you can determine if the request has failed depends on how you call
Amazon SES. The following are examples of how errors and exceptions are returned:
If you are calling Amazon SES through the Query (HTTPS) API (SendEmail or SendRawEmail),
the actions will return an error. For more information, see the Amazon Simple Email Service API
Reference.
If you are using an AWS SDK for a programming language that uses exceptions, the call to Amazon
SES will throw a MessageRejectedException. (The name of the exception may vary slightly
depending on the SDK.)
If you are using the SMTP interface, then the sender receives an SMTP response code, but how the
error is conveyed depends on the sender's client. Some clients may display an error code; others
may not.
For information about errors that can occur when you send an email with Amazon SES, see Amazon
SES Email Sending Errors (p. 231).
Hard bounceThe email is rejected by the ISP because of a persistent condition or rejected by
Amazon SES because the email address is on the Amazon SES suppression list. An email address
is on the Amazon SES suppression list if it has recently caused a hard bounce for any Amazon SES
customer. A hard bounce with an ISP can occur because the recipient's address is invalid. A hard
bounce notification is sent from the ISP back to Amazon SES, which notifies the sender through
email or through Amazon Simple Notification Service (Amazon SNS), depending on the sender's
setup. Amazon SES notifies the sender of suppression list bounces by the same means. The path of
a hard bounce from an ISP is shown in the following figure.
Soft bounceThe ISP cannot deliver the email to the recipient because of a temporary condition,
such as the ISP is too busy to handle the request or the recipient's mailbox is full. A soft bounce can
also occur if the domain does not exist. The ISP sends a soft bounce notification back to Amazon
SES, or, in the case of a nonexistent domain, Amazon SES cannot find an email server for the
domain. In either case, Amazon SES retries the email for an extended period of time. If Amazon
SES cannot deliver the email in that time period, it sends you a bounce notification through email
or through Amazon SNS. If Amazon SES can deliver the email to the recipient during a retry, the
delivery is successful. A soft bounce is shown in the following figure. In this case, Amazon SES
retries sending the email, and the ISP is eventually able to deliver it to the recipient.
ComplaintThe email is accepted by the ISP and delivered to the recipient, but the recipient
considers the email to be spam and clicks a button such as "Mark as spam" in his or her email client.
If Amazon SES has a feedback loop set up with the ISP, then a complaint notification is sent to
Amazon SES, which forwards the complaint notification to the sender. Most ISPs do not provide
the email address of the recipient who submitted the complaint, so the complaint notification from
Amazon SES provides the sender a list of recipients who might have sent the complaint, based on
the recipients of the original message and the ISP from which Amazon SES received the complaint.
The path of a complaint is shown in the following figure.
Auto responseThe email is accepted by the ISP, and the ISP delivers it to the recipient. The ISP
then sends an automatic response such as an out-of-the-office (OOTO) message to Amazon SES.
Amazon SES forwards the auto response notification to the sender. An auto response is shown in
the following figure.
Make sure that your Amazon SES-enabled program does not retry sending messages that generate
an auto response.
Tip
You can use the Amazon SES mailbox simulator to test a successful delivery, bounce,
complaint, OOTO, or what happens when an address is on the suppression list. For more
information, see Testing Amazon SES Email Sending (p. 224).
The following is a simple example of an email. The header is followed by a blank line and then the
body of the email. The envelope isn't shown because it is communicated between the client and the
mail server during the SMTP session, rather than a part of the email itself.
The following sections review email headers and bodies and identify the information that you need to
provide when you use Amazon SES.
Email Header
There is one header per email message. Each line of the header contains a field followed by a colon
followed by a field body. When you read an email in an email client, the email client typically displays
the values of the following header fields:
ToThe email addresses of the message's recipients.
CCThe email addresses of the message's carbon copy recipients.
FromThe email address from which the email is sent.
SubjectA summary of the message topic.
DateThe time and date the email is sent.
There are many additional header fields that provide routing information and describe the content of
the message. Email clients typically do not display these fields to the user. For a full list of the header
fields that Amazon SES accepts, see Appendix: Header Fields (p. 342). When you use Amazon SES,
you particularly need to understand the difference between "From," "Reply-To," and "Return-Path"
header fields. As noted previously, the "From" address is the email address of the message sender,
whereas "Reply-To" and "Return-Path" are as follows:
Reply-ToThe email address to which replies will be sent. By default, replies are sent to the original
sender's email address.
Return-PathThe email address to which message bounces and complaints should be sent.
"Return-Path" is sometimes called "envelope from," "envelope sender," or "MAIL FROM."
Note
When you use Amazon SES, we recommend that you always set the "Return-Path"
parameter so that you can be aware of bounces and take corrective action if they occur.
To easily match a bounced message with its intended recipient, you can use Variable Envelope Return
Path (VERP). With VERP, you set a different "Return-Path" for each recipient, so that if the message
API Version 2010-12-01
13
bounces back, you automatically know which recipient it bounced from, rather than having to open the
bounce message and parse it.
Email Body
The email body contains the text of the message. The body can be sent in the following formats:
HTMLIf the recipient's email client can interpret HTML, the body can include formatted text and
hyperlinks
Plain textIf the recipient's email client is text-based, the body must not contain any nonprintable
characters.
Both HTML and plain textWhen you use both formats to send the same content in a single
message, the recipient's email client decides which to display, based upon its capabilities.
If you are sending an email message to a large number of recipients, then it makes sense to send
it in both HTML and text. Some recipients will have HTML-enabled email clients, so that they can
click embedded hyperlinks in the message. Recipients using text-based email clients will need you to
include URLs that they can copy and open using a web browser.
address, and message data. If you are using the SMTP interface and have feedback forwarding
enabled, then your bounces, complaints, and delivery notifications are sent to the "MAIL FROM"
address. Any "Reply-To" address that you specify is not used.
For more information about sending email using the Amazon SES SMTP interface, see Using the
Amazon SES SMTP Interface to Send Email (p. 56).
Next steps
After you send a few test emails to yourself, use the Amazon SES mailbox simulator for further
testing because emails to the mailbox simulator do not count towards your sending quota or your
bounce and complaint rates. For more information on the mailbox simulator, see Testing Amazon
SES Email Sending (p. 224).
Monitor your sending activity, such as the number of emails that you have sent and the number that
have bounced or received complaints. For more information, see Monitoring Your Amazon SES
Sending Activity (p. 103).
Verify entire domains so that you can send email from any email address in your domain without
verifying addresses individually. For more information, see Verifying Domains in Amazon
SES (p. 41).
Increase the chance that your emails will be delivered to your recipients' inboxes instead of junk
boxes by authenticating your emails. For more information, see Authenticating Your Email in
Amazon SES (p. 92).
For technical discussions about various Amazon SES topics, visit the Amazon SES Blog. To browse
and post questions, go to the Amazon SES Forum.
on to one of the other sending methods and use the Amazon SES console primarily to monitor your
sending activity.
To start this tutorial, go to Send an Email Using the Amazon SES Console (p. 17).
For technical discussions about various Amazon SES topics, visit the Amazon SES Blog. To browse
and post questions, go to the Amazon SES Forum.
emails. After you get started with Amazon SES, you will want to send your emails using either the
Amazon SES SMTP interface or API, but the console is still useful for monitoring your sending activity.
Important
In this getting started tutorial, you send an email to yourself so that you can check to see if
you received it. For further experimentation or load testing, use the Amazon SES mailbox
simulator. Emails that you send to the mailbox simulator do not count toward your sending
quota or your bounce and complaint rates. For more information, see Testing Amazon SES
Email Sending (p. 224).
Before you follow these steps, make sure you review the setup instructions in Before You Begin with
Amazon SES (p. 17).
Sign in to the AWS Management Console and open the Amazon SES console at Amazon SES
console. If you are not currently signed into your AWS account, this link will take you to a sign-in
page. After you sign in, you will be directed to the Amazon SES console.
2.
In the Navigation pane of the Amazon SES console, under Identity Management, choose Email
Addresses to view the email address that you verified in Verifying Email Addresses in Amazon
SES (p. 39).
3.
In the list of identities, select the checkbox of an email address that you have verified.
4.
5.
In the Send Test Email dialog box, choose the Email Format. The two choices are as follows:
FormattedThis is the simplest option. Choose this if you simply want to type the text of your
message into the Body text box. When you send the email, Amazon SES will put the text into
email format for you.
RawChoose this option if you want to send a more complex message, such as a message
that includes HTML or an attachment. Because of this flexibility, you will need to format the
message as described in Sending Raw Email Using the Amazon SES API (p. 88) yourself,
and then paste the entire formatted message, including the headers, into the Body text box.
You can use the following example, which contains HTML, to send a test email using the Raw
email format. Copy and paste this message in its entirety into the Body text box. Ensure that
there is not a blank line between the MIME-Version header and the Content-Type header,
because that would cause the email to be formatted as plain text instead of HTML.
Subject: Amazon SES Raw Email Test
MIME-Version: 1.0
Content-Type: text/html
<!DOCTYPE html>
<html>
<body>
<h1>This text should be large, because it is formatted as a header in
HTML.</h1>
<p>Here is a formatted link: <a href="http://docs.aws.amazon.com/
ses/latest/DeveloperGuide/Welcome.html">Amazon Simple Email Service
Developer Guide</a>.</p>
</body>
</html>
6.
In the Send Test Email dialog box, fill out the rest of the fields. If you are still in the Amazon SES
sandbox, make sure that you have verified the address in the To field. For more information, see
Verifying Email Addresses in Amazon SES (p. 39).
7.
8.
Sign in to the email client of the address you sent the email to. You will find the message that you
sent.
Important
Your SMTP credentials are different from your AWS credentials. For more information about
credentials, see Using Credentials With Amazon SES (p. 323).
The Amazon SES SMTP hostname, which is email-smtp.us-east-1.amazonaws.com (for region
us-east-1), email-smtp.us-west-2.amazonaws.com (for region us-west-2), or email-smtp.euwest-1.amazonaws.com (for region eu-west-1).
The Amazon SES SMTP interface port number, which depends on the connection method. For more
information, see Connecting to the Amazon SES SMTP Endpoint (p. 61).
After you have obtained your SMTP credentials, you can connect to the Amazon SES SMTP endpoint
and start sending email. This getting started tutorial shows you how to send email through the Amazon
SES SMTP interface by using the following methods:
Send an Email by Accessing the Amazon SES SMTP Interface Programmatically (p. 19)
Configuring Your Existing Email Server or SMTP-Enabled Application to Send Email Through
Amazon SES (p. 28)
For more information about the Amazon SES SMTP interface, see Using the Amazon SES SMTP
Interface to Send Email (p. 56).
Before you perform the following procedure, complete the setup tasks described in Before You Begin
with Amazon SES (p. 17) and Send an Email Through Amazon SES Using SMTP (p. 19).
Important
In this getting started tutorial, you send an email to yourself so that you can check to see if
you received it. For further experimentation or load testing, use the Amazon SES mailbox
simulator. Emails that you send to the mailbox simulator do not count toward your sending
quota or your bounce and complaint rates. For more information, see Testing Amazon SES
Email Sending (p. 224).
2.
b.
c.
In the New Project dialog box, in the left pane, expand Installed, expand Templates, and
then expand Visual C#.
d.
e.
f.
In the Name field, type AmazonSESSample. The dialog box should look similar to the
following figure.
g. Choose OK.
In your Visual Studio project, replace the entire contents of Program.cs with the following code:
using System;
namespace AmazonSESSample
{
class Program
{
static void Main(string[] args)
{
API Version 2010-12-01
20
// Replace with
// Replace with a
// sandbox, this
3.
In Program.cs, replace the following email addresses with your own values:
Important
The email addresses are case-sensitive. Make sure that the addresses are exactly the
same as the ones you verified.
[email protected] with your "From" email address. You must verify this
address before you run this program. For more information, see Verifying Email Addresses and
Domains in Amazon SES (p. 39).
[email protected] with your "To" email address. If your account is still in
the sandbox, you must verify this address before you use it. For more information, see Moving
Out of the Amazon SES Sandbox (p. 54).
4.
In Program.cs, replace the following SMTP credentials with the values that you obtained in
Obtaining Your Amazon SES SMTP Credentials (p. 57):
Important
Your SMTP credentials are different from your AWS credentials. For more information
about credentials, see Using Credentials With Amazon SES (p. 323).
YOUR_SMTP_USERNAMEReplace with your SMTP username. Note that your SMTP
username credential is a 20-character string of letters and numbers, not an intelligible name.
YOUR_SMTP_PASSWORDReplace with your SMTP password.
5.
(Optional) If you want to use an Amazon SES SMTP endpoint in a region other than US West
(Oregon), you need to change HOST in Program.cs to the endpoint you want to use. For a list of
Amazon SES endpoints, see Regions and Amazon SES (p. 332).
6.
Save Program.cs.
7.
To build the project, choose Build and then choose Build Solution.
8.
To run the program, choose Debug and then choose Start Debugging.
9.
Review the program's console output to verify that the sending was successful. (You should see
"Email sent!")
10. Log into the email client of the recipient address. You will find the message that you sent.
Send an Email Through the Amazon SES SMTP Interface with Java
This example uses Eclipse IDE for Java EE Developers and the JavaMail API to send email through
Amazon SES using the SMTP interface. The JavaMail API is included in the Java EE Platform and is
available as an optional package for use with the Java SE Platform. If you do not have the JavaMail
API installed, install it from JavaMail.
Important
This tutorial requires JavaMail 1.5 or above.
Before you perform the following procedure, complete the setup tasks described in Before You Begin
with Amazon SES (p. 17) and Send an Email Through Amazon SES Using SMTP (p. 19).
Important
In this getting started tutorial, you send an email to yourself so that you can check to see if
you received it. For further experimentation or load testing, use the Amazon SES mailbox
simulator. Emails that you send to the mailbox simulator do not count toward your sending
quota or your bounce and complaint rates. For more information, see Testing Amazon SES
Email Sending (p. 224).
API Version 2010-12-01
22
To send an email using the Amazon SES SMTP interface with Java
1.
Open Eclipse.
b.
In Eclipse, choose File, choose New, and then choose Java Project.
c.
In the Create a Java Project dialog box, type a project name and then choose Next.
d.
e.
f.
Browse to your installation of JavaMail, choose mail.jar, and then choose Open. The Java
Settings dialog box should now look similar to the following figure:
g.
2.
3.
Under your project, right-click the src directory, choose New, and then choose Class.
4.
In the New Java Class dialog box, in the Name field, type AmazonSESSample and then choose
Finish.
5.
// Replace with
// Replace with a
// sandbox, this
static final String BODY = "This email was sent through the Amazon SES
SMTP interface by using Java.";
static final String SUBJECT = "Amazon SES test (SMTP interface
accessed using Java)";
// Supply your SMTP credentials below. Note that your SMTP credentials
are different from your AWS credentials.
static final String SMTP_USERNAME = "YOUR_SMTP_USERNAME"; // Replace
with your SMTP username.
static final String SMTP_PASSWORD = "YOUR_SMTP_PASSWORD"; // Replace
with your SMTP password.
// Amazon SES SMTP host name. This example uses the US West (Oregon)
region.
static final String HOST = "email-smtp.us-west-2.amazonaws.com";
// The port you will connect to on the Amazon SES SMTP endpoint. We
are choosing port 25 because we will use
// STARTTLS to encrypt the connection.
static final int PORT = 25;
public static void main(String[] args) throws Exception {
// Create a Properties object to contain connection configuration
information.
Properties props = System.getProperties();
props.put("mail.transport.protocol", "smtps");
props.put("mail.smtp.port", PORT);
// Set properties indicating that we want to use STARTTLS to encrypt
the connection.
// The SMTP session will begin on an unencrypted connection, and then
the client
// will issue a STARTTLS command to upgrade to an encrypted
connection.
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.starttls.enable", "true");
props.put("mail.smtp.starttls.required", "true");
// Create a Session object to represent a mail session with the
specified properties.
Session session = Session.getDefaultInstance(props);
// Create a message with the specified information.
MimeMessage msg = new MimeMessage(session);
msg.setFrom(new InternetAddress(FROM));
msg.setRecipient(Message.RecipientType.TO, new
InternetAddress(TO));
msg.setSubject(SUBJECT);
msg.setContent(BODY,"text/plain");
// Create a transport.
Transport transport = session.getTransport();
// Send the message.
try
{
6.
In AmazonSESSample.java, replace the following email addresses with your own values:
Important
The email addresses are case-sensitive. Make sure that the addresses are exactly the
same as the ones you verified.
[email protected] with your "From" email address. You must verify this
address before you run this program. For more information, see Verifying Email Addresses and
Domains in Amazon SES (p. 39).
[email protected] with your "To" email address. If your account is still in
the sandbox, you must verify this address before you use it. For more information, see Moving
Out of the Amazon SES Sandbox (p. 54).
7.
In AmazonSESSample.java, replace the following SMTP credentials with the values that you
obtained in Obtaining Your Amazon SES SMTP Credentials (p. 57):
Important
Your SMTP credentials are different from your AWS credentials. For more information
about credentials, see Using Credentials With Amazon SES (p. 323).
YOUR_SMTP_USERNAMEReplace with your SMTP username credential. Note that your
SMTP username credential is a 20-character string of letters and numbers, not an intelligible
name.
YOUR_SMTP_PASSWORDReplace with your SMTP password.
8.
(Optional) If you want to use an Amazon SES SMTP endpoint in a region other than US West
(Oregon), you need to change HOST in AmazonSESSample.java to the endpoint you want to use.
For a list of Amazon SES endpoints, see Regions and Amazon SES (p. 332).
9.
Save AmazonSESSample.java.
10. To build the project, choose Project and then choose Build Project. (If this option is disabled,
then you may have automatic building enabled.)
11. To start the program and send the email, choose Run and then choose Run again.
12. Review the program's console output to verify that the sending was successful. (You should see
"Email sent!")
13. Log into the email client of the recipient address. You will find the message that you sent.
API Version 2010-12-01
25
Send an Email Through the Amazon SES SMTP Interface with PHP
This example uses the PHP Extension and Application Repository (PEAR) to send email through
Amazon SES using the SMTP interface.
Important
In this tutorial, you send an email to yourself so that you can check to see if you received
it. For further experimentation or load testing, use the Amazon SES mailbox simulator.
Emails that you send to the mailbox simulator do not count toward your sending quota or
your bounce and complaint rates. For more information, see Testing Amazon SES Email
Sending (p. 224).
Prerequisites
Before you begin, perform the following tasks:
Verify your email address with Amazon SES Before you can send an email with Amazon SES,
you must verify that you own the sender's email address. If your account is still in the Amazon SES
sandbox, you must also verify the recipient email address. The easiest way to verify email addresses
is by using the Amazon SES console. For more information, see Verification Procedures (p. 40).
Get your SMTP credentialsYou need an Amazon SES SMTP user name and password to
access the Amazon SES SMTP interface. Your SMTP credentials are not the same as your AWS
credentials. You can find your SMTP credentials by going to the SMTP Settings page of the Amazon
SES console. For more information about SMTP credentials, see Obtaining Your Amazon SES
SMTP Credentials (p. 57).
Install PHPPHP is available at http://php.net/downloads.php. After you install PHP, add the path
to PHP in your environment variables so that you can run PHP from any command prompt.
Install the PEAR package managerThe PEAR package manager, which is available at https://
pear.php.net/manual/en/installation.getting.php, will enable you to download the required PEAR
packages.
Install the PEAR Mail and Net_SMTP packages The PEAR Mail package is available at http://
pear.php.net/package/Mail, and the PEAR Net_SMTP package is available at https://pear.php.net/
package/Net_SMTP.
Procedure
The following procedure shows how to send an email through the Amazon SES with PHP.
To send an email using the Amazon SES SMTP interface with PHP
1.
Create a file named amazon-ses-smtp-sample.php. Open the file with a text editor and paste in the
following code:
<?php
// Replace [email protected] with your "From" address.
// This address must be verified with Amazon SES.
define('SENDER', '[email protected]');
// Replace [email protected] with a "To" address. If your account
// is still in the sandbox, this address must be verified.
define('RECIPIENT', '[email protected]');
// Replace smtp_username with your Amazon SES SMTP user name.
define('USERNAME','smtp_username');
// Replace smtp_password with your Amazon SES SMTP password.
define('PASSWORD','smtp_password');
API Version 2010-12-01
26
2.
smtp_passwordReplace with your SMTP password, which you obtained from the SMTP
Settings page of the Amazon SES console. This is not the same as your AWS secret access
key.
(Optional) email-smtp.us-west-2.amazonaws.comIf you want to use an Amazon SES
SMTP endpoint in a region other than US West (Oregon), replace this with the Amazon SES
SMTP endpoint in the region you want to use. For a list of Amazon SES SMTP endpoints, see
Regions and Amazon SES (p. 332).
3.
Save amazon-ses-smtp-sample.php.
4.
To run the program, open a command prompt in the same directory as amazon-ses-smtpsample.php, and enter php amazon-ses-smtp-sample.php.
5.
Review the output. If the sending succeeded, you will see "Email sent!"
6.
Log in to the email client of the recipient address. You will find the message that you sent.
Send an Email Through Amazon SES Using the AWS SDK for Java (p. 32)
Send an Email Through Amazon SES Using the AWS SDK for PHP (p. 35)
Important
In this getting started tutorial, you send an email to yourself so that you can check to see if
you received it. For further experimentation or load testing, use the Amazon SES mailbox
simulator. Emails that you send to the mailbox simulator do not count toward your sending
quota or your bounce and complaint rates. For more information, see Testing Amazon SES
Email Sending (p. 224).
b.
c.
In the New Project dialog box, in the left pane, expand Installed, expand Templates, and
then expand Visual C#.
d.
e.
f.
In the Name field, type AmazonSESSample. The dialog box should look similar to the
following figure.
g.
Choose OK.
API Version 2010-12-01
29
2.
In the AWS Access Credentials dialog box, select an existing account or enter the following
information:
Display NameType a name that identifies your account. Next time you create an AWS
project in Visual Studio, you will be able to select this account so you do not have to enter the
information again.
Access Key IDEnter the AWS access key ID that you obtained in Getting Your AWS Access
Keys (p. 46).
Secret Access KeyEnter the AWS secret access key that you obtained in Getting Your AWS
Access Keys (p. 46).
Account Number(Optional) Enter your AWS account number. To find your AWS account
number, go to the Security Credentials page in the AWS Management Console and choose
Account Identifiers. (If you are not logged into your AWS account, this link will take you to an
AWS account sign-in page first.) At the bottom of the page, under Account Identifiers, you will
see your AWS Account ID.
Default RegionSelect the AWS region of the Amazon SES endpoint you want to connect
to. Note that your sandbox status, sending limits, and Amazon SES identity-related settings
are specific to a given AWS region, so be sure to select an AWS region in which you set up
Amazon SES. For a list of AWS regions that Amazon SES supports, see Regions and Amazon
SES (p. 332).
3.
Choose OK.
4.
In your Visual Studio project, replace the entire contents of Program.cs with the following code:
using
using
using
using
System;
System.Collections.Generic;
Amazon.SimpleEmail;
Amazon.SimpleEmail.Model;
namespace AmazonSESSample
{
class Program
{
public static void Main(string[] args)
{
API Version 2010-12-01
30
}
}
}
5.
Important
The email addresses are case-sensitive. Make sure that the addresses are exactly the
same as the ones you verified.
[email protected] with your "From" email address. You must verify this
address before you run this program. For more information, see Verifying Email Addresses and
Domains in Amazon SES (p. 39).
[email protected] with your "To" email address. If your account is still in
the sandbox, you must verify this address before you use it. For more information, see Moving
Out of the Amazon SES Sandbox (p. 54).
REGIONSet this to the AWS region of the Amazon SES endpoint you want to connect to.
Note that your sandbox status, sending limits, and Amazon SES identity-related settings are
specific to a given AWS region, so be sure to select an AWS region in which you set up Amazon
SES. In this example, we are using the US West (Oregon) region. Examples of other regions
that Amazon SES supports are USEast1 and EUWest1. For a complete list of AWS regions that
Amazon SES supports, see Regions and Amazon SES (p. 332).
6.
7.
Save Program.cs.
To build the project, choose Build and then choose Build Solution.
8.
9.
To run the program, choose Debug and then choose Start Debugging.
Review the program's console output to verify that the sending was successful. (You should see
"Email sent!")
10. Log into the email client of the recipient address. You will find the message that you sent.
Send an Email Through Amazon SES Using the AWS SDK for
Java
The following procedure shows you how to use Eclipse IDE for Java EE Developers and AWS Toolkit
for Eclipse to create an AWS SDK project and modify the Java code to send an email through Amazon
SES. It retrieves your AWS credentials from environment variables.
Before you begin this procedure, complete the setup tasks described in Before You Begin with Amazon
SES (p. 17) and Send an Email Through Amazon SES Using an AWS SDK (p. 28).
Important
In this getting started tutorial, you send an email to yourself so that you can check to see if
you received it. For further experimentation or load testing, use the Amazon SES mailbox
simulator. Emails that you send to the mailbox simulator do not count toward your sending
quota or your bounce and complaint rates. For more information, see Testing Amazon SES
Email Sending (p. 224).
2.
3.
Create an environment variable called AWS_ACCESS_KEY_ID and set it to your AWS access key
ID. The procedure for setting environment variables depends on your operating system. Your AWS
access key ID will look something like: AKIAIOSFODNN7EXAMPLE.
Create an environment variable called AWS_SECRET_ACCESS_KEY and set it to your AWS
secret access key. Your AWS secret access key will look something like: wJalrXUtnFEMI/
K7MDENG/bPxRfiCYEXAMPLEKEY.
Create an AWS Java Project in Eclipse by performing the following steps:
API Version 2010-12-01
32
a.
Open Eclipse.
b.
In Eclipse, choose File, choose New, and then choose AWS Java Project. If you do not see
AWS Java Project as an option, try selecting Other.
c.
In the Create an AWS Java Project dialog box, type a project name.
d.
Choose Finish.
4.
5.
Under your project, right-click the src directory, choose New, and then choose Class.
6.
In the Java Class dialog box, in the Name field, type AmazonSESSample and then choose Finish.
7.
import
import
import
import
java.io.IOException;
com.amazonaws.services.simpleemail.*;
com.amazonaws.services.simpleemail.model.*;
com.amazonaws.regions.*;
8.
Important
The email addresses are case-sensitive. Make sure that the addresses are exactly the
same as the ones you verified.
[email protected] with your "From" email address. You must verify this
address before you run this program. For more information, see Verifying Email Addresses and
Domains in Amazon SES (p. 39).
[email protected] with your "To" email address. If your account is still in
the sandbox, you must verify this address before you use it. For more information, see Moving
Out of the Amazon SES Sandbox (p. 54).
API Version 2010-12-01
34
REGIONSet this to the AWS region of the Amazon SES endpoint you want to connect to.
Note that your sandbox status, sending limits, and Amazon SES identity-related settings are
specific to a given AWS region, so be sure to select an AWS region in which you set up Amazon
SES. In this example, we are using the US West (Oregon) region. Examples of other regions
that Amazon SES supports are US_EAST_1 and EU_WEST_1. For a complete list of AWS
regions that Amazon SES supports, see Regions and Amazon SES (p. 332).
9.
Save AmazonSESSample.java.
10. To build the project, choose Project and then choose Build Project. (If this option is disabled, you
may have automatic building enabled.)
11. To start the program and send the email, choose Run and then choose Run again.
12. Review the program's console output to verify that the sending was successful. (You should see
"Email sent!")
13. Log into the email client of the recipient address. You will find the message that you sent.
Send an Email Through Amazon SES Using the AWS SDK for
PHP
This topic shows how to use the AWS SDK for PHP to send an email through Amazon SES.
Important
In this tutorial, you send an email to yourself so that you can check to see if you received
it. For further experimentation or load testing, use the Amazon SES mailbox simulator.
Emails that you send to the mailbox simulator do not count toward your sending quota or
your bounce and complaint rates. For more information, see Testing Amazon SES Email
Sending (p. 224).
Prerequisites
Before you begin, perform the following tasks:
Verify your email address with Amazon SESBefore you can send an email with Amazon SES,
you must verify that you own the sender's email address. If your account is still in the Amazon SES
sandbox, you must also verify the recipient email address. The easiest way to verify email addresses
is by using the Amazon SES console. For more information, see Verification Procedures (p. 40).
Get your AWS credentialsYou need an AWS access key ID and AWS secret access key to
access Amazon SES using an SDK. You can find your credentials by using the Security Credentials
page of the AWS Management Console. For more information about credentials, see Using
Credentials With Amazon SES (p. 323).
Install PHPPHP is available at http://php.net/downloads.php. This tutorial requires PHP version
5.5 or higher. After you install PHP, add the path to PHP in your environment variables so that you
can run PHP from any command prompt.
Install the AWS SDK for PHP version 3.xFor download and installation instructions, see the
AWS SDK for PHP documentation.
Procedure
The following procedure shows how to send an email through Amazon SES using the AWS SDK for
PHP.
To send an email through Amazon SES using the AWS SDK for PHP
1.
Set up your AWS credentials by creating the following environment variables. For alternate ways
to set up your AWS credentials, see the AWS SDK for PHP documentation.
API Version 2010-12-01
35
Note
The procedure for creating environment variables depends on your operating system.
2.
a.
Create an environment variable called AWS_ACCESS_KEY_ID and set it to your AWS access
key ID. Your AWS access key ID will look something like: AKIAIOSFODNN7EXAMPLE.
b.
Create a file named amazon-ses-sample.php. Open the file with a text editor and paste in the
following code:
<?php
// Replace path_to_sdk_inclusion with the path to the SDK as described in
// http://docs.aws.amazon.com/aws-sdk-php/v3/guide/getting-started/basicusage.html
define('REQUIRED_FILE','path_to_sdk_inclusion');
// Replace [email protected] with your "From" address.
// This address must be verified with Amazon SES.
define('SENDER', '[email protected]');
// Replace [email protected] with a "To" address. If your account
// is still in the sandbox, this address must be verified.
define('RECIPIENT', '[email protected]');
// Replace us-west-2 with the AWS region you're using for Amazon SES.
define('REGION','us-west-2');
define('SUBJECT','Amazon SES test (AWS SDK for PHP)');
define('BODY','This email was sent with Amazon SES using the AWS SDK for
PHP.');
require REQUIRED_FILE;
use Aws\Ses\SesClient;
$client = SesClient::factory(array(
'version'=> 'latest',
'region' => REGION
));
$request = array();
$request['Source'] = SENDER;
$request['Destination']['ToAddresses'] = array(RECIPIENT);
$request['Message']['Subject']['Data'] = SUBJECT;
$request['Message']['Body']['Text']['Data'] = BODY;
try {
$result = $client->sendEmail($request);
$messageId = $result->get('MessageId');
echo("Email sent! Message ID: $messageId"."\n");
} catch (Exception $e) {
echo("The email was not sent. Error message: ");
echo($e->getMessage()."\n");
}
?>
3.
4.
Save amazon-ses-sample.php.
5.
To run the program, open a command prompt in the same directory as amazon-ses-sample.php,
and enter php amazon-ses-sample.php.
6.
Review the output. If the sending succeeded, you will see "Email sent!"
Note
If you encounter a "cURL error 60: SSL certificate problem" error when you run the
program, download the latest CA bundle as described in the AWS SDK for PHP
documentation. Then, in amazon-ses-sample.php, add the following lines to the
SesClient::factory array, replace path_of_certs with the path to the CA bundle
you downloaded, and re-run the program.
'http' => [
'verify' => 'path_of_certs\ca-bundle.crt'
]
7.
Log in to the email client of the recipient address. You will find the message that you sent.
If you want to call the Amazon SES API without handling the low-level details of the Query interface,
you can use an AWS SDK. For more information, see Downloading an AWS SDK (p. 46).
If you want to access Amazon SES through its SMTP interface, you need to obtain your SMTP user
name and password. Your SMTP credentials are different from your AWS credentials. For more
information, see Getting Your SMTP Credentials for Amazon SES (p. 54).
When you first sign up for Amazon SES, your account is in the Amazon SES sandbox. In the
sandbox, you can send emails using the same email-sending methods as any other Amazon SES
user, except that you can only send 200 emails per 24-hour period at a maximum rate of one
email per second, and you can only send emails to addresses you have verified. To increase your
sending limits and to send email to unverified email addresses, see Moving Out of the Amazon SES
Sandbox (p. 54).
If you want your emails to pass Domain-based Message Authentication, Reporting and Conformance
(DMARC) authentication based on Sender Policy Framework (SPF), configure your identity to send
from a custom MAIL FROM domain as described in Using a Custom MAIL FROM Domain (p. 46).
For technical discussions about various Amazon SES topics, visit the Amazon SES Blog. To browse
and post questions, go to the Amazon SES Forum.
Note
If you will be sending your emails from an Amazon EC2 instance either directly or through
AWS Elastic Beanstalk, you can get started with Amazon SES for free. For more information,
see Amazon SES Pricing.
When you first sign up for AWS, your Amazon SES sending is in the Amazon SES sandbox. In the
sandbox, you have full access to the Amazon SES API and SMTP interface. However, the following
restrictions are in effect:
You can only send emails to the Amazon SES mailbox simulator and to email addresses or domains
that you have verified. For more information, see Verifying Email Addresses and Domains in Amazon
SES (p. 39).
You can send a maximum of 200 messages per 24-hour period.
You can send a maximum of one message per second.
For information about moving out of the sandbox, see Moving Out of the Amazon SES
Sandbox (p. 54).
2.
Note
Even if your account is out of the Amazon SES sandbox, you still need to verify your "From"
address to confirm that you own it.
Overview
With the exception of addresses containing labels (see below), you must verify each email address
(or the domain of the email address) that you will use as a "From", "Source", "Sender", or "ReturnPath" address for your messages. Until your account is out of the Amazon SES sandbox, you must
also verify the email address of every recipient except for the recipients provided by the Amazon SES
mailbox simulator. For more information about the mailbox simulator, see Testing Amazon SES Email
Sending (p. 224). For more information about moving out of the sandbox, see Moving Out of the
Amazon SES Sandbox (p. 54).
Important notes about email address verification are as follows:
The entire email address is case-sensitive. For example, if you verify [email protected], you
cannot send emails from [email protected] unless you verify [email protected] also.
(Domain verification, however, is case-insensitive. For more information, see Verifying Domains in
Amazon SES (p. 41).)
If you individually verify an email address and you also verify the domain of that address, the verified
identity settings (such as DKIM and feedback notifications) of the email address override the domainlevel settings. For example, if you verify example.com and [email protected], and you have
DKIM enabled for example.com but not enabled for [email protected], then emails you send
from [email protected] will not be DKIM-signed.
Amazon SES has endpoints in multiple AWS regions, and email address verification status is
separate for each AWS region. You must complete the email address verification process for each
sender in the AWS region(s) you want to use. For information about using Amazon SES in multiple
AWS regions, see Regions and Amazon SES (p. 332).
You can verify as many as 1,000 identities (domains and email addresses, in any combination) per
AWS account.
Verifying an email address also allows you to set the "From" and "Return-Path" address to any
address formed by adding a label to the verified address. Addresses that contain labels are of the
form [email protected], with user-specified text between the plus sign (+) and the at sign
(@).
API Version 2010-12-01
39
For example, if you verify [email protected], you can also send email from user
[email protected], [email protected], and so on. This makes it
possible to support Variable Envelope Return Path (VERP) the use of a different return
path for each recipient. For more information about VERP, see http://en.wikipedia.org/wiki/
Variable_envelope_return_path.
When you verify an unlabeled address, then you are essentially verifying all addresses that
are formed by adding a label to the verified address. The opposite, however is not true.
Verifying an email address that already contains a label does not allow you to send from
other addresses. For example, verifying [email protected] does not allow
you to send from [email protected], [email protected], or andrew
[email protected].
If you want to use the SendRawEmail API action to send a message that contains a "Sender"
header, then you must first verify the email address or domain in that header. For more information,
see About Email Header Fields (p. 88).
Verification Procedures
The following procedures show how to use the Amazon SES console to verify and view email
addresses.
Go to your email address list in the Amazon SES console, or follow these instructions to navigate
to it:
a.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
b.
2.
3.
In the Verify a New Email Address dialog box, type your email address in the indicated field, and
then choose Verify This Email Address.
4.
In your email client, open the message from Amazon SES asking you to confirm that you are the
owner of this email address.
5.
Note
The link in the verification message expires 24 hours after your original verification
request.
API Version 2010-12-01
40
6.
7.
The status of the email address in the Amazon SES console will change from "pending
verification" to "verified".
You can now use Amazon SES to send email from this address. To send a test email, check the
box next to the verified email address, and then choose Send a Test Email.
Go to your email address list in the Amazon SES console, or follow these instructions to navigate
to it:
a.
b.
2.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
In the navigation pane, under Identity Management, choose Email Addresses.
In the list of verified email addresses, you can expand one or more email addresses to view the
details.
Go to your email address list in the Amazon SES console, or follow these instructions to navigate
to it:
a.
b.
2.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
In the navigation pane, under Identity Management, choose Email Addresses.
Check the box beside each email address that you want to remove, and then choose Remove.
Note
The API actions above are preferable to the following older API actions, which are deprecated
as of the May 15, 2012 release of Domain Verification.
VerifyEmailAddress
ListVerifiedEmailAddresses
DeleteVerifiedEmailAddress
You can use these API actions to write a customized front-end application for email address
verification. For a complete description of the API actions related to email verification, go to the
Amazon Simple Email Service API Reference.
example, if you verify the domain example.com, you can send email from [email protected],
[email protected], or any other user at example.com.
You can manage your verified domains by using the Amazon SES console or the Amazon SES API.
For a complete description of API actions related to domain verification, go to the Amazon Simple
Email Service API Reference. This section, which demonstrates the actions using the Amazon SES
console, contains the following topics:
Verifying a Domain With Amazon SES (p. 42)
Viewing Your Domains Verified With Amazon SES (p. 44)
Removing a Domain Verified With Amazon SES (p. 44)
Amazon SES Domain Verification Revocation (p. 44)
Amazon SES Domain Verification TXT Records (p. 45)
Important notes about domain verification are as follows:
Amazon SES has endpoints in multiple AWS regions, and domain verification applies to each AWS
region separately. You must perform the entire domain verification procedure for each region in
which you want to send from a given domain. If you want to verify the same domain in multiple
regions and your DNS provider does not allow you to have multiple TXT records with the same
name, see the workarounds in Common Domain Verification Problems (p. 234).
If you verify a domain with Amazon SES, you can send from any subdomain of that domain without
specifically verifying the subdomain. For example, if you verify example.com, you do not need to
verify a.example.com or a.b.example.com. As specified in RFC 1034, each DNS label can have up
to 63 characters and the whole domain name must not exceed a total length of 255 characters.
If you verify a domain, subdomain(s), and/or email address(es) that share a root domain, the verified
identity settings (such as feedback notifications and Easy DKIM) apply at the most granular level you
verified. That is:
Verified email address settings override verified domain settings.
Verified subdomain settings override verified domain settings, with lower-level subdomain settings
overriding higher-level subdomain settings.
For example, assume you verify [email protected], a.b.example.com, b.example.com, and
example.com. These are the verified identity settings that will be used in the following scenarios:
Emails sent from [email protected] (an address that is not specifically verified) will use the
settings for example.com.
Emails sent from [email protected] (an address that is specifically verified) will use the
settings for [email protected].
Emails sent from [email protected] (an address that is not specifically verified) will use the
settings for b.example.com.
Domain names are case-insensitive. If you verify example.com, you can send from EXAMPLE.com
also.
You can verify as many as 1,000 identities (domains and email addresses, in any combination) per
AWS account.
To verify a domain
1.
Go to your verified domain list in the Amazon SES console, or follow these instructions to
navigate to it:
API Version 2010-12-01
42
a.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
b.
2.
3.
In the Verify a New Domain dialog box, enter the domain name. If you want to set up DKIM
signing for this domain, select the Generate DKIM Settings option. (For information about DKIM
signing, see Authenticating Email with DKIM in Amazon SES (p. 93).) Choose Verify This
Domain.
4.
In the Verify a New Domain dialog box, you will see a Domain Verification Record Set
containing a Name, a Type, and a Value. (This information will also be available by choosing the
domain name after you close the dialog box.)
To complete domain verification, add a TXT record with the displayed Name and Value to your
domain's DNS server. For information about Amazon SES TXT records and general guidance
about how to add a TXT record to a DNS server, see Amazon SES Domain Verification TXT
Records (p. 45). In particular:
If your DNS provider does not allow underscores in record names, you can omit _amazonses
from the Name.
To help you easily identify this record within your domain's DNS settings, you can optionally
prefix the Value with amazonses:
Some DNS providers automatically append the domain name to DNS record names. To avoid
duplication of the domain name, you can add a period to the end of the domain name in the
DNS record. This indicates that the record name is fully qualified and the DNS provider need not
append an additional domain name.
5.
If Amazon Route 53 provides the DNS service for the domain that you are verifying, and you are
signed in to the AWS Management Console under the same account that you use for Amazon
Route 53, then Amazon SES will give you the option of updating your DNS server immediately
from within the Amazon SES console. If you are not using Amazon Route 53, Amazon SES needs
to verify that a TXT record with the specified Name and Value have been added to your domain's
DNS server. This may take up to 72 hours.
When verification is complete, the domain's status in the Amazon SES console will change from
"pending verification" to "verified," and you will receive a confirmation success email from Amazon
SES to the email address associated with your AWS account.
6.
You can now use Amazon SES to send email from any address in the verified domain. To send a
test email, check the box next to the verified domain, and then choose Send a Test Email.
If the DNS settings are not correctly updated, you will receive a domain verification failure email from
Amazon SES, and the domain will display a status of "failed" in the Domains tab. If this happens, read
our troubleshooting page at Amazon SES Domain Verification Problems (p. 233). When you have
verified that your TXT record is correctly in place, choose the "retry" link next to the "failed" status
notification. This will reinitiate the domain verification process.
2.
Go to your verified domain list in the Amazon SES console, or follow these instructions to navigate
to it:
a.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
b.
In the list of verified domains, you can expand one or more domains to view the details.
Go to your verified domain list in the Amazon SES console, or follow these instructions to navigate
to it:
a.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
b.
2.
Check the box beside each domain that you want to remove, and then choose Remove.
3.
You will no longer be able to send email from the removed domain.
Note
You can review the required TXT record information in the Amazon SES console by using the
following instructions. In the navigation pane, under Identity Management, choose Domains.
In the list of domains, choose (not just expand) the domain to display the domain verification
settings, which include the TXT record name and value.
If you do not restore the TXT record information to your domain's DNS server within 72 hours, you will
receive an Amazon SES Domain Verification REVOCATION email from Amazon SES, the domain
will be removed from the list of Verified Senders on the Domains tab, and you will no longer be able
to send from the domain.
To reverify a domain for which verification has been revoked, you must restart the verification
procedure from the beginning, just as if the revoked domain were an entirely new domain.
Type
Value
_amazonses.example.com
TXT
pmBGN/7MjnfhTKUZ06Enqq1PeG
Add a TXT record to your domain's DNS server using the specified Name and Value. Amazon SES
domain verification is complete when Amazon SES detects the existence of the TXT record in your
domain's DNS settings.
If your DNS provider does not allow DNS record names to contain underscores, you
can omit _amazonses from the Name. In that case, for the preceding example, the TXT
record name would be example.com instead of _amazonses.example.com. To make the
record easier to recognize and maintain, you can also optionally prefix the Value with
amazonses:. In the previous example, the value of the TXT record would therefore be
amazonses:pmBGN/7MjnfhTKUZ06Enqq1PeGUaOkw8lGhcfwefcHU=.
Note
Amazon SES previously allowed TXT record names to contain amazonses without an
underscore. If you have already verified a domain and your TXT record contains amazonses
without an underscore, your domain will continue to be verified; there is no action required on
your part. However, any new domains that you verify will require that amazonses in the TXT
record name is either preceded by an underscore, or _amazonses is removed from the TXT
record name entirely.
You can find troubleshooting information and instructions on how to check your domain verification
settings in Amazon SES Domain Verification Problems (p. 233).
Go to your DNS provider's website. If you are not sure which DNS provider serves your domain,
try looking it up by using a free Whois service.
API Version 2010-12-01
45
2.
3.
4.
Find the page for updating your domain's DNS records. This page often has a name such as DNS
Records, DNS Zone File, Advanced DNS, or something similar.
Locate the TXT records for your domain.
5.
Add a TXT record with the name and value provided by Amazon SES.
Important
Some DNS providers automatically append the domain name to the end of
DNS records. Adding a record that already contains the domain name (such as
_amazonses.example.com) might result in the duplication of the domain name (such as
_amazonses.example.com.example.com). To avoid duplication of the domain name, add
a period to the end of the domain name in the DNS record. This will indicate to your DNS
provider that the record name is fully qualified (that is, no longer relative to the domain
name), and prevent the DNS provider from appending an additional domain name.
6.
Save your changes. DNS record updates can take up to 48 hours to take effect, but they often
take effect much sooner. You can verify that the TXT record is correctly published by using the
procedure in How to Check Domain Verification Settings (p. 233).
Note
The getting started section of this developer guide provides examples of how to send an email
by using the AWS SDKs for .NET, Java, and PHP. For more information, see Send an Email
Through Amazon SES Using an AWS SDK (p. 28).
To see a list of all the AWS SDKs, go to Sample Code and Libraries.
Setup Process
To set the MAIL FROM domain for a verified identity, you configure the verified identity using the
Amazon SES console or API and publish an MX record (and optionally, an SPF record) to your MAIL
FROM domain's DNS server. If at any point you want to return to using the default Amazon SES MAIL
FROM domain, you can remove your MAIL FROM domain from the verified identity's settings. These
procedures are described in the following sections:
Setting a MAIL FROM Domain (p. 47)
Removing a MAIL FROM Domain (p. 50)
Editing a MAIL FROM Domain (p. 51)
For a description of custom MAIL FROM domain setup states, see MAIL FROM Domain Setup
States (p. 53).
Note
You can use the same MAIL FROM address in multiple AWS regions. For more information,
see Regions and Amazon SES (p. 332).
You use the Amazon SES console or API to configure the identity to use a MAIL FROM domain
that you specify.
2.
You publish an MX record to the DNS server of the MAIL FROM domain. Amazon SES provides
you with this record during the setup process. For example, if you are configuring identity
example.com to use the MAIL FROM domain bounce.example.com in the US West (Oregon)
region, Amazon SES will provide you with the following MX record settings:
Name
Type
Value
bounce.example.com
MX
10 feedbacksmtp.uswest-2.amazonses.com
The endpoint in the record value depends on the AWS region. For a list of feedback endpoints for
all AWS regions, see Custom MAIL FROM Domains (p. 335).
3.
(Optional) If you want your emails to pass Sender Policy Framework (SPF) checks, you must
publish an SPF record to the DNS server of the custom MAIL FROM domain. Amazon SES
provides you with this record during the setup process. The SPF record for MAIL FROM domain
bounce.example.com would have the following settings:
Name
Type
Value
bounce.example.com
TXT
For further details on setting up SPF records, see Authenticating Email with SPF in Amazon
SES (p. 92).
Go to your verified email address list in the Amazon SES console, or follow these instructions to
navigate to it:
a.
2.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
b. In the navigation pane, under Identity Management, choose Email Addresses.
In the verified email address list, confirm that the status of the email address for which you want to
set the MAIL FROM domain is verified. If the status is failure, choose retry and then click the link
within the verification email you receive in your email client. Otherwise, choose the email address
and continue this procedure.
API Version 2010-12-01
48
3.
In the details pane of the verified email address, expand MAIL FROM Domain.
4.
5.
In the Set MAIL FROM Domain dialog box, type the name of the MAIL FROM domain that you
want to use. Note that this must be a subdomain of the domain of the verified email address.
6.
Later in this procedure, you must publish an MX record to the DNS server of the custom MAIL
FROM domain. Here, for Behavior if MX record not found, choose what you want Amazon SES
to do if it cannot successfully read that record when you send an email. You have the following
options:
Use default Amazon SES valueIf the custom MAIL FROM domain's MX record is not set
up correctly, Amazon SES will use the default MAIL FROM domain (amazonses.com or a
subdomain of amazonses.com).
Reject messageIf the custom MAIL FROM domain's MX record is not set up correctly,
Amazon SES will return a MailFromDomainNotVerified error and not send the email.
7.
8.
Next, you must publish an MX record to the DNS server of the custom MAIL FROM domain.
Important
To successfully set up a custom MAIL FROM domain with Amazon SES, you must
publish exactly one MX record to the DNS server of your MAIL FROM domain. If the MAIL
FROM domain has multiple MX records, the custom MAIL FROM setup with Amazon
SES will fail.
9.
a.
If Amazon Route 53 provides the DNS service for your MAIL FROM domain, and you are
signed in to the AWS Management Console under the same account that you use for Amazon
Route 53, then choose Publish Records Using Route 53 if you want to publish the MX
record and/or SPF record from within the Amazon SES console.
b.
If your MAIL FROM domain does not use Amazon Route 53, then you must publish the
displayed MX record to the MAIL FROM domain's DNS server yourself. The procedure for
adding an MX record to your domain's DNS server depends on who provides your DNS
service; please see the documentation for your DNS service. After Amazon SES detects the
record, emails you send from this verified email address will use the specified MAIL FROM
domain. Until then, Amazon SES will either use the default MAIL FROM domain or reject the
message, depending on the preferences you specified earlier in this procedure. Amazon SES
can take up to 72 hours to detect your MX record.
(Optional) If you want Sender Policy Framework (SPF) checks to succeed, you must publish an
SPF record to your MAIL FROM domain's DNS server to show receiving mail servers that you
have authorized Amazon SES to send email on behalf of your domain. For more information, see
Authenticating Email with SPF in Amazon SES (p. 92).
Go to your verified domain list in the Amazon SES console, or follow these instructions to
navigate to it:
a.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
b.
2.
In the verified domain list, confirm that the status of the domain for which you want to set
the MAIL FROM domain is verified. If the status is failure, choose retry and then add the
displayed TXT record to your DNS server, as described in Amazon SES Domain Verification TXT
Records (p. 45). Otherwise, choose the domain and continue this procedure.
3.
In the details pane of the verified domain, expand MAIL FROM Domain.
4.
5.
In the Set MAIL FROM Domain dialog box, type the name of the MAIL FROM domain that you
want to use. Note that this must be a subdomain of the verified domain.
6.
Later in this procedure, you must publish an MX record to the verified domain's DNS server. Here,
for Behavior if MX record not found, choose what you want Amazon SES to do if it cannot
successfully read that record when you send an email. You have the following options:
Use default Amazon SES valueIf the custom MAIL FROM domain's MX record is not set
up correctly, Amazon SES will use the default MAIL FROM domain (amazonses.com or a
subdomain of amazonses.com).
Reject messageIf the custom MAIL FROM domain's MX record is not set up correctly,
Amazon SES will return a MailFromDomainNotVerified error and not send the email.
7.
8.
Next, you must publish an MX record to the DNS server of the custom MAIL FROM domain.
Important
To successfully set up a custom MAIL FROM domain with Amazon SES, you must
publish exactly one MX record to the DNS server of your MAIL FROM domain. If the MAIL
FROM domain has multiple MX records, the custom MAIL FROM setup with Amazon
SES will fail.
9.
a.
If Amazon Route 53 provides the DNS service for your MAIL FROM domain, and you are
signed in to the AWS Management Console under the same account that you use for Amazon
Route 53, then choose Publish Records Using Route 53 if you want to publish the MX
record and/or SPF record from within the Amazon SES console.
b.
If your MAIL FROM domain does not use Amazon Route 53, then you must publish the
displayed MX record to the MAIL FROM domain's DNS server yourself. The procedure for
adding an MX record to your domain's DNS server depends on who provides your DNS
service; please see the documentation for your DNS service. After Amazon SES detects the
record, emails you send from this verified domain will use the specified MAIL FROM domain.
Until then, Amazon SES will either use the default MAIL FROM domain or reject the message,
depending on the preferences you specified earlier in this procedure. Amazon SES can take
up to 72 hours to detect your MX record.
(Optional) If you want Sender Policy Framework (SPF) checks to succeed, you must publish an
SPF record to your MAIL FROM domain's DNS server to show receiving mail servers that you
have authorized Amazon SES to send email on behalf of your domain. For more information, see
Authenticating Email with SPF in Amazon SES (p. 92).
To remove a custom MAIL FROM domain from the configuration of a verified email
address
1.
Go to your verified email address list in the Amazon SES console, or follow these instructions to
navigate to it:
a.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
b.
2.
In the verified email address list, choose the verified email address for which you want to remove
the custom MAIL FROM domain.
3.
In the details pane of the verified email address, expand MAIL FROM Domain.
4.
5.
6.
(Optional) Log in to your DNS service and remove the MX record that you published when you set
up the MAIL FROM domain with Amazon SES.
7.
(Optional) Remove the SPF record that you published when you set up the custom MAIL FROM
domain with Amazon SES.
To remove a custom MAIL FROM domain from the configuration of a verified domain
1.
Go to your verified domain list in the Amazon SES console, or follow these instructions to navigate
to it:
a.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
b.
2.
In the verified domain list, choose the verified domain for which you want to remove the custom
MAIL FROM domain.
3.
In the details pane of the verified domain, expand MAIL FROM Domain.
4.
5.
6.
(Optional) Log in to your DNS service and remove the MX record that you published when you set
up the MAIL FROM domain with Amazon SES.
7.
(Optional) Remove the SPF record that you published when you set up the custom MAIL FROM
domain with Amazon SES.
Go to your verified email address list in the Amazon SES console, or follow these instructions to
navigate to it:
a.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
b.
2.
In the verified email address list, choose the email address for which you want to configure the
MAIL FROM domain.
3.
In the details pane of the verified email address, expand MAIL FROM Domain.
4.
5.
In the Edit MAIL FROM Domain dialog box, edit the settings and then choose Save MAIL FROM
Domain.
6.
If you changed the MAIL FROM domain name when you edited the settings, you must publish an
MX record to the DNS server of the new MAIL FROM domain.
API Version 2010-12-01
51
7.
a.
If Amazon Route 53 provides the DNS service for your MAIL FROM domain, and you are
signed in to the AWS Management Console under the same account that you use for Amazon
Route 53, then choose Publish Records Using Route 53 if you want to publish the MX
record and/or SPF record from within the Amazon SES console.
b.
If your domain does not use Amazon Route 53, then you must publish the displayed MX
record to the MAIL FROM domain's DNS server yourself. The procedure for adding an MX
record to your domain's DNS server depends on who provides your DNS service; please
see the documentation for your DNS service. After Amazon SES detects the record, emails
you send from this verified email address will use the specified MAIL FROM domain. Until
then, Amazon SES will either use the default MAIL FROM domain or reject the message,
depending on the preferences you specified earlier in this procedure. Amazon SES can take
up to 72 hours to detect your MX record.
(Optional) If you changed the MAIL FROM domain name and you want Sender Policy Framework
(SPF) checks to succeed, you must publish an SPF record to your MAIL FROM domain's DNS
server to show receiving mail servers that you have authorized Amazon SES to send email on
behalf of your domain. For more information, see Authenticating Email with SPF in Amazon
SES (p. 92).
Go to your verified domain list in the Amazon SES console, or follow these instructions to navigate
to it:
a.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
b.
2.
In the verified domain list, choose the domain for which you want to configure the MAIL FROM
domain.
3.
In the details pane of the verified domain, expand MAIL FROM Domain.
4.
5.
In the Edit MAIL FROM Domain dialog box, edit the settings and then choose Save MAIL FROM
Domain.
6.
If you changed the MAIL FROM domain name when you edited the settings, you must publish an
MX record to the DNS server of the new MAIL FROM domain.
7.
a.
If Amazon Route 53 provides the DNS service for your MAIL FROM domain, and you are
signed in to the AWS Management Console under the same account that you use for Amazon
Route 53, then choose Publish Records Using Route 53 if you want to publish the MX
record and/or SPF record from within the Amazon SES console.
b.
If your domain does not use Amazon Route 53, then you must publish the displayed MX
record to the MAIL FROM domain's DNS server yourself. The procedure for adding an MX
record to your domain's DNS server depends on who provides your DNS service; please see
the documentation for your DNS service. After Amazon SES detects the record, emails you
send from this verified domain will use the specified MAIL FROM domain. Until then, Amazon
SES will either use the default MAIL FROM domain or reject the message, depending on the
preferences you specified earlier in this procedure. Amazon SES can take up to 72 hours to
detect your MX record.
(Optional) If you changed the MAIL FROM domain name and you want Sender Policy Framework
(SPF) checks to succeed, you must publish an SPF record to your MAIL FROM domain's DNS
server to show receiving mail servers that you have authorized Amazon SES to send email on
behalf of your domain. For more information, see Authenticating Email with SPF in Amazon
SES (p. 92).
Amazon SES
Actions
Pending
Amazon SES
attempts to detect
the required
MX record for
72 hours. If
unsuccessful, the
state changes to
"Failed".
Success
Amazon SES
continuously
checks that the
required MX
record is in place.
TemporaryFailure
Amazon SES
attempts to detect
the required
MX record for
72 hours. If
unsuccessful, the
state changes
to "Failed"; if
successful, the
state changes to
"Success".
Failed
Amazon SES no
longer attempts
to detect the
required MX
record. To use
a custom MAIL
FROM domain,
you must restart
the setup process
in Setting a
MAIL FROM
Domain (p. 47).
Authentication, Reporting and Conformance (DMARC) authentication based on SPF. For more
information, see Authenticating Email with SPF in Amazon SES (p. 92).
Important
Your SMTP user name and password are not the same as your AWS access key ID and
secret access key. Do not attempt to use your AWS credentials to authenticate yourself to the
Amazon SES SMTP endpoint. For more information about credentials, see Using Credentials
With Amazon SES (p. 323).
2.
Open an SES Sending Limits Increase case. To navigate to case creation, you can go to Support
Center, choose Create Case, choose Service Limit Increase, and then select SES Sending
Limits as the limit type.
3.
Note
The rate at which Amazon SES accepts your messages might be less than the
maximum send rate.
New limit value:Enter the amount you are requesting. Be sure to only request the amount
you think you'll need. Keep in mind that you are not guaranteed to receive the amount
you request, and the higher the limit you request, the more justification you will need to be
considered for that amount.
Mail type: Select Transactional, System Notifications, Subscription, Marketing, or Other.
Website URL. Provide a link to your website. Although it isn't required, we highly recommend
that you provide one if you have it, because it helps us evaluate your request.
API Version 2010-12-01
54
My email-sending complies with the AWS Service Terms and AWS Acceptable Use Policy
(AUP). Select Yes or No.
I only send to recipients who have specifically requested my mail. Select Yes or No. For
tips on how to send high-quality mail and keep your recipient list clean, see Obtaining and
Maintaining Your Recipient List (p. 228) and the Amazon Simple Email Service Email Sending
Best Practices whitepaper.
I have a process to handle bounces and complaints. Select Yes or No. For information
on how to monitor and handle bounces and complaints, see Processing Bounces and
Complaints (p. 228).
Use Case Description. Explain your situation in as much detail as possible. For example,
describe the type of emails you are sending and how email-sending fits into your business.
The more information you can provide that indicates that you are sending high-quality emails to
recipients who want and expect it, the more likely we are to approve your request. The higher
the limit value you are requesting, the more detail you should provide.
We will respond to the case after reviewing your request. Please allow one business day for
processing. If you are granted a sending limit increase, then you have also been moved out of the
sandbox and no longer need to verify your "To" addresses.
The following are three ways to determine whether you have moved out of the sandbox:
The correspondence in your SES Sending Limits Increase case indicates that your request has been
granted.
You can successfully use Amazon SES to send an email message from your verified email address
to an unverified address that you own. If you receive a MessageRejected error instead, stating that
your email address is not verified, then you are still in the sandbox.
The Amazon SES console shows that your sending quota is higher than 200 messages per 24-hour
period. To learn more, see Monitoring Your Amazon SES Sending Limits (p. 193).
Once you are out of the sandbox, you no longer have to verify "To" addresses or domains; however,
you must still verify any additional "From" or "Return-Path" addresses or domains. Over time, Amazon
SES will gradually increase your sending limits, or you can open another SES Sending Limits Increase
case if the gradual increase does not meet your needs. For more information, see Managing Your
Amazon SES Sending Limits (p. 192).
Important
When you send an email to multiple recipients (recipients are "To", "CC", and "BCC"
addresses) and the call to Amazon SES fails, the entire email is rejected and none of the
recipients will receive the intended email. We therefore recommend that you send an email to
one recipient at a time.
For technical discussions about various Amazon SES topics, visit the Amazon SES Blog. To browse
and post questions, go to the Amazon SES Forum.
Note
For solutions to common problems that you might encounter when you use Amazon SES
through its SMTP interface, see Amazon SES SMTP Issues (p. 238).
To send email using the Amazon SES SMTP interface, you will need the following:
An AWS account. For more information, see Signing up for AWS (p. 38).
The SMTP interface hostname (i.e., endpoint). For a list of Amazon SES SMTP endpoints, see
Connecting to the Amazon SES SMTP Endpoint (p. 61).
The SMTP interface port number. The port number varies with the connection method. For more
information, see Connecting to the Amazon SES SMTP Endpoint (p. 61).
An SMTP user name and password. You can use the same set of SMTP credentials in all AWS
regions.
Important
Your SMTP user name and password are not identical to your AWS access keys or the
credentials you use to log into the Amazon SES console. For information about how to
generate your SMTP user name and password, see Obtaining Your Amazon SES SMTP
Credentials (p. 57).
Client software that can communicate using Transport Layer Security (TLS). For more information,
see Connecting to the Amazon SES SMTP Endpoint (p. 61).
An email address that you have verified with Amazon SES. For more information, see Verifying
Email Addresses and Domains in Amazon SES (p. 39).
Higher sending limits, if you want to send large quantities of email. For more information, see
Managing Your Amazon SES Sending Limits (p. 192).
Then, you can send email by doing the following:
To configure an email client to send email through Amazon SES, including an example for Microsoft
Outlook, see Configuring Email Clients to Send Through Amazon SES (p. 62).
API Version 2010-12-01
56
To configure SMTP-enabled software to send email through the Amazon SES SMTP interface,
including an example for issue-tracking software Jira, see Sending Email Through Amazon SES
From Software Packages (p. 66).
To program an application to send email through Amazon SES, see Sending Email Through Amazon
SES From Your Application (p. 67).
To configure your existing email server to send all of your outgoing mail through Amazon SES, see
Integrating Amazon SES with Your Existing Email Server (p. 67).
To interact with the Amazon SES SMTP interface using the command line, which can be useful
for testing, see Using the Command Line to Send Email Through the Amazon SES SMTP
Interface (p. 85).
For a list of SMTP response codes, see SMTP Response Codes Returned by Amazon SES (p. 240).
Important
Your SMTP user name and password are not the same as your AWS access key ID and
secret access key. Do not attempt to use your AWS credentials to authenticate yourself
against the SMTP endpoint. For more information about credentials, see Using Credentials
With Amazon SES (p. 323).
There are two ways to generate your SMTP credentials. You can either use the Amazon SES console
or you can generate your SMTP credentials from your AWS credentials.
Use the Amazon SES console to generate your SMTP credentials if:
You want to get your SMTP credentials using the simplest method.
You do not need to automate SMTP credential generation using code or a script.
Generate your SMTP credentials from your AWS credentials if:
You have an existing AWS Identity and Access Management (IAM) user that you created using
the IAM interface and you want that user to be able to send emails using the Amazon SES SMTP
interface.
You want to automate SMTP credential generation using code or a script.
For information on each method, see Obtaining Amazon SES SMTP Credentials Using the Amazon
SES Console (p. 58) and Obtaining Amazon SES SMTP Credentials by Converting AWS
Credentials (p. 59).
API Version 2010-12-01
57
Obtaining Amazon SES SMTP Credentials Using the Amazon SES Console
When you generate SMTP credentials by using the Amazon SES console, the Amazon SES console
creates an IAM user with the appropriate policies to call Amazon SES and provides you with the SMTP
credentials associated with that user.
Note
An IAM user can create Amazon SES SMTP credentials, but the IAM user's policy must give
them permission to use IAM itself, because Amazon SES SMTP credentials are created
through IAM. If the IAM user tries to create Amazon SES SMTP credentials using the console
and they don't have IAM permissions, they will get an error that says " not authorized to
perform iam:ListUsers" In that case, the root account owner needs to modify the IAM user's
policy to allow them to access the following IAM actions: "iam:ListUsers", "iam:CreateUser",
"iam:CreateAccessKey", and "iam:PutUserPolicy".
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
2.
3.
4.
In the Create User for SMTP dialog box, you will see that an SMTP user name has been filled in
for you. You can accept this suggested user name or enter a different one. To proceed, choose
Create.
5.
Choose Show User SMTP Credentials. Your SMTP credentials will be displayed on the screen;
copy them and store them in a safe place. You can also choose Download Credentials to
download a file that contains your credentials.
Important
This is the only time that you will be able to view your SMTP credentials! We strongly
advise you to download these credentials and refrain from sharing them with others.
6.
If you want to delete your SMTP credentials, go to the IAM console at https://
console.aws.amazon.com/iam/ and delete the IAM user name that corresponds with your SMTP
credentials. To learn more, go to the Using IAM guide.
If you want to change your SMTP password, go to the IAM console and delete your existing IAM user,
and then go to the Amazon SES console to re-generate your SMTP credentials.
Important
Do not use temporary AWS credentials to derive SMTP credentials. The Amazon SES SMTP
interface does not support SMTP credentials that have been generated from temporary
security credentials.
To enable the IAM user to send email using the Amazon SES SMTP interface, you need to do the
following two steps:
Derive the user's SMTP credentials from their AWS credentials using the algorithm provided in this
section. Because you are starting from AWS credentials, the SMTP username will be the same as
the AWS access key ID, so you just need to generate the SMTP password.
Important
If you generate SMTP credentials using the Amazon SES console, the SMTP username is
not the same as the AWS access key ID. The SMTP username and the AWS access key
ID are only the same if you generate the SMTP password programmatically, as described in
this section.
Apply the following policy to the IAM user:
{ "Statement": [{
"Effect":"Allow",
"Action":"ses:SendRawEmail",
"Resource":"*"
}]}
For more information about using Amazon SES with IAM, see Controlling Access to Amazon
SES (p. 307).
Note
Although you can generate Amazon SES SMTP credentials for any existing IAM user, we
recommend for security reasons that you create a separate IAM user for the AWS credentials
that you will use to generate the SMTP password. For information about why it is good
practice to create users for specific purposes, go to IAM Best Practices.
The following pseudocode shows the algorithm that converts an AWS Secret Access Key to an
Amazon SES SMTP password.
key = AWS Secret Access Key;
message = "SendRawEmail";
versionInBytes = 0x02;
signatureInBytes = HmacSha256(message, key);
signatureAndVer = Concatenate(versionInBytes, signatureInBytes);
smtpPassword = Base64(signatureAndVer);
The following is an example Java implementation that converts an AWS Secret Access Key to an
Amazon SES SMTP password. Before you run the program, put the AWS Secret Access Key of
API Version 2010-12-01
59
the IAM user into an environment variable called AWS_SECRET_ACCESS_KEY. The output of
the program is the SMTP password. That password, along with the SMTP username (which, if you
generate the SMTP password programmatically, is the same as the AWS access key ID) are the user's
Amazon SES SMTP credentials.
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import javax.xml.bind.DatatypeConverter;
public class SesSmtpCredentialGenerator {
private static final String KEY_ENV_VARIABLE =
"AWS_SECRET_ACCESS_KEY"; // Put your AWS secret access key in this
environment variable.
private static final String MESSAGE = "SendRawEmail"; // Used to
generate the HMAC signature. Do not modify.
private static final byte VERSION = 0x02; // Version number. Do not
modify.
public static void main(String[] args) {
// Get the AWS secret access key from environment variable
AWS_SECRET_ACCESS_KEY.
String key = System.getenv(KEY_ENV_VARIABLE);
if (key == null)
{
System.out.println("Error: Cannot find environment variable
AWS_SECRET_ACCESS_KEY.");
System.exit(0);
}
// Create an HMAC-SHA256 key from the raw bytes of the AWS
secret access key.
SecretKeySpec secretKey = new SecretKeySpec(key.getBytes(),
"HmacSHA256");
try {
// Get an HMAC-SHA256 Mac instance and initialize it
with the AWS secret access key.
Mac mac = Mac.getInstance("HmacSHA256");
mac.init(secretKey);
// Compute the HMAC signature on the input data bytes.
byte[] rawSignature = mac.doFinal(MESSAGE.getBytes());
// Prepend the version number to the signature.
byte[] rawSignatureWithVersion = new
byte[rawSignature.length + 1];
byte[] versionArray = {VERSION};
System.arraycopy(versionArray, 0,
rawSignatureWithVersion, 0, 1);
System.arraycopy(rawSignature, 0,
rawSignatureWithVersion, 1, rawSignature.length);
// To get the final SMTP password, convert the HMAC
signature to base 64.
String smtpPassword =
DatatypeConverter.printBase64Binary(rawSignatureWithVersion);
System.out.println(smtpPassword);
}
catch (Exception ex) {
System.out.println("Error generating SMTP password: " +
ex.getMessage());
}
}
}
SMTP endpoint
email-smtp.us-east-1.amazonaws.com
US West (Oregon)
email-smtp.us-west-2.amazonaws.com
EU (Ireland)
email-smtp.eu-west-1.amazonaws.com
The Amazon SES SMTP endpoint requires that all connections be encrypted using Transport Layer
Security (TLS). (Note that TLS is often referred to by the name of its predecessor protocol, SSL.)
Amazon SES supports two mechanisms for establishing a TLS-encrypted connection: STARTTLS
and TLS Wrapper. Check the documentation for your software to determine whether it supports
STARTTLS, TLS Wrapper, or both.
If your software does not support STARTTLS or TLS Wrapper, you can use the open source stunnel
program to set up an encrypted connection (called a "secure tunnel"), then use the secure tunnel to
connect to the Amazon SES SMTP endpoint.
Important
Amazon Elastic Compute Cloud (Amazon EC2) throttles email traffic over port 25 by default.
To avoid timeouts when sending email through the SMTP endpoint from EC2, use a different
port (587 or 2587) or fill out a Request to Remove Email Sending Limitations to remove the
throttle.
STARTTLS
STARTTLS is a means of upgrading an unencrypted connection to an encrypted connection. There are
versions of STARTTLS for a variety of protocols; the SMTP version is defined in RFC 3207.
To set up a STARTTLS connection, the SMTP client connects to the Amazon SES SMTP endpoint
on port 25, 587, or 2587, issues an EHLO command, and waits for the server to announce that it
supports the STARTTLS SMTP extension. The client then issues the STARTTLS command, initiating
TLS negotiation. When negotiation is complete, the client issues an EHLO command over the new
encrypted connection, and the SMTP session proceeds normally.
TLS Wrapper
TLS Wrapper (also known as SMTPS or the Handshake Protocol) is a means of initiating an encrypted
connection without first establishing an unencrypted connection. With TLS Wrapper, the Amazon SES
SMTP endpoint does not perform TLS negotiation: it is the client's responsibility to connect to the
endpoint using TLS, and to continue using TLS for the entire conversation. TLS Wrapper is an older
protocol, but many clients still support it.
To set up a TLS Wrapper connection, the SMTP client connects to the Amazon SES SMTP endpoint
on port 465 or 2465. The server presents its certificate, the client issues an EHLO command, and the
SMTP session proceeds normally.
API Version 2010-12-01
61
Secure Tunnel
If your software does not support STARTTLS or TLS Wrapper, you can set up a secure tunnel to allow
your software to communicate with the Amazon SES SMTP endpoint. As this option is most commonly
used by mail server administrators, details are given under Integrating Amazon SES with Your Existing
Email Server (p. 67).
2.
3.
In the Add Account dialog box, choose Manual setup or additional server types, and then
choose Next.
4.
Under Choose Service, choose POP or IMAP, and then choose Next.
5.
Under POP and IMAP Account Settings, fill in the following fields:
a.
b.
Email Address Type the email address from which you will send emails. You must verify
this email address or domain (p. 39). The email address is case-sensitive. Make sure that
the address is exactly the same as the one you verified.
c.
d.
Incoming mail server Type none. (Even though you are setting up Amazon SES for
outgoing email only, this field is required.)
e.
Outgoing mail server (SMTP)Type the SMTP endpoint for the outgoing mail server.
For a list of Amazon SES SMTP endpoints, see Connecting to the Amazon SES SMTP
Endpoint (p. 61). For example, if you use the Amazon SES endpoint in the US West
(Oregon) Region, the outgoing mail server is email-smtp.us-west-2.amazonaws.com.
f.
User Name Type none. (You will configure your credentials later in this procedure.)
6.
7.
In the Internet E-mail Settings dialog box, choose the Outgoing Server tab and fill in the
following fields:
a.
b.
c.
User NameEnter your SMTP user name credential, which is the string of letters and
numbers you obtained using the procedure in Obtaining Your Amazon SES SMTP
Credentials (p. 57).
Important
Your SMTP user name (p. 57) is not the same as your AWS access key ID.
d.
Password Enter your SMTP password, which is the string of letters and numbers you
obtained using the procedure in Obtaining Your Amazon SES SMTP Credentials (p. 57).
Important
Your SMTP password (p. 57) is not the same as your AWS secret access key.
e.
8.
Choose the Advanced tab, and then fill in the following fields.
Note
This example shows a typical configuration. For alternative configurations, see
Connecting to the Amazon SES SMTP Endpoint (p. 61). The Outlook-encrypted
connection type labeled TLS corresponds to STARTTLS (p. 61), and the Outlookencrypted connection type labeled SSL corresponds to TLS Wrapper (p. 61).
a.
b.
9.
Choose OK.
10. On the Add Account page, choose Test Account Settings. This lets you test your setup by
having Outlook send an email through Amazon SES.
Note
Because you are using Amazon SES as your outgoing email server only, the Log onto
incoming mail server test is expected to fail. The Send test e-mail test should pass.
11. If the test message that Outlook sends through Amazon SES arrives successfully, clear the Test
Account Settings by clicking the Next button check box (because the test will fail without
setting up incoming email) and then choose Next.
12. Choose Next, and then choose Finish.
13. You set up Amazon SES for email sending only. To ensure that the account is not set up to
receive messages using Amazon SES, you must disable mail retrieval for the account by using the
following steps.
a.
b.
On the Send/Receive tab, choose Send/Receive Groups, and then choose Define Send/
Receive Groups.
c.
d.
In the Accounts section on the left, choose the account you just created for sending mail
through Amazon SES.
e.
f.
2.
3.
4.
5.
6.
On the Add SMTP Mail Server form, fill in the following fields:
a.
b.
From addressThe address from which email will be sent. You will need to verify this
email address with Amazon SES before you can send from it. For more information about
verification, see Verifying Email Addresses and Domains in Amazon SES (p. 39).
c.
Email prefixA string that JIRA prepends to each subject line prior to sending.
d.
ProtocolChoose SMTP.
Note
If you cannot connect to Amazon SES using this setting, try SECURE_SMTP.
e.
Host NameSee Connecting to the Amazon SES SMTP Endpoint (p. 61) for a
list of Amazon SES SMTP endpoints. For example, if you want to use the Amazon
SES endpoint in the US West (Oregon) region, the host name would be email-smtp.uswest-2.amazonaws.com.
f.
SMTP Port25, 587, or 2587 (to connect using STARTTLS), or 465 or 2465 (to connect
using TLS Wrapper).
g.
h.
i.
7.
Choose Test Connection. If the test email that JIRA sends through Amazon SES arrives
successfully, then your configuration is complete.
The Amazon SES SMTP endpoint requires that all connections be encrypted using Transport Layer
Security (TLS). If you want to use TLS Wrapper but your MTA does not support TLS Wrapper, you
can set up a "secure tunnel" to provide TLS Wrapper support. For more information, see Setting Up a
Secure Tunnel to Connect to Amazon SES (p. 68).
Important
Some MTAs have native support for TLS Wrapper, while others do not. Check the
documentation for your mail server to determine whether it supports TLS Wrapper. If it
supports TLS Wrapper, then you do not need to set up a secure tunnel.
These instructions were tested on a 64-bit Amazon EC2 instance using the following Amazon Machine
Image (AMI), which is based on Red Hat:
Amazon Linux AMI 2014.09.2 (HVM) (ami-146e2a7c).
To launch an Amazon EC2 instance, which includes selecting an AMI, see Amazon Machine Images
(AMIs).
To set up a secure tunnel to the Amazon SES US West (Oregon) endpoint using stunnel
1.
2.
If you are using Ubuntu Linux, stunnel may require a certificate. To generate the certificate, go to
the /etc/stunnel directory and at a command prompt, type the following:
sudo openssl req -new -out mail.pem -keyout mail.pem -nodes -x509 -days
365
3.
4.
To configure the secure tunnel, add the following lines to stunnel.conf. For the accept line, specify
a port number that is outside the range of reserved ports and is not currently being used. For this
example, we will use port 2525 for this purpose.
These instructions assume that you want to use Amazon SES in the US West (Oregon)
AWS region. If you want to use a different region, replace the instance of email-smtp.uswest-2.amazonaws.com in these instructions with the SMTP endpoint of the desired region. For a
list of SMTP endpoints, see Regions and Amazon SES (p. 332).
Important
Be sure to include delay = yes, which delays the DNS look-up until it is needed.
Otherwise, the stunnel connection may fail.
[smtp-tls-wrapper]
accept = 2525
client = yes
connect = email-smtp.us-west-2.amazonaws.com:465
delay = yes
5.
If you are using stunnel version 4.36 or lower, add this additional line to stunnel.conf:
API Version 2010-12-01
68
sslVersion = TLSv1
6.
If you are using Ubuntu Linux, add this additional line to stunnel.conf:
cert = /etc/stunnel/mail.pem
7.
Save stunnel.conf.
8.
9.
At a command prompt, type the following command to verify that the tunnel has been created.
We are using port 2525 for this example; if you have specified a different port number, modify the
command accordingly.
telnet localhost 2525
To configure integration with the Amazon SES US West (Oregon) endpoint using
STARTTLS
1.
On your mail server, open the main.cf file. On many systems, this file resides in the /etc/postfix
folder.
Important
These instructions assume that you want to use Amazon SES in the US West (Oregon)
AWS region. If you want to use a different region, replace all instances of email-smtp.usAPI Version 2010-12-01
69
On your mail server, open the master.cf file. On many systems, this file resides in the /etc/postfix
folder.
4.
Comment out the following line of the master.cf file by putting a # in front of it: -o
smtp_fallback_relay=
Save and close the master.cf file.
5.
Edit the /etc/postfix/sasl_passwd file. If the file does not exist, create it. Add the following lines to
the file, replacing USERNAME and PASSWORD with your SMTP user name and password. If
Postfix cannot authenticate with the Amazon SES SMTP endpoint because the hostname does not
match, try adding the additional line specified in Amazon SES SMTP Issues (p. 238).
Important
Use your SMTP user name and password, not your AWS access key ID and secret
access key. Your SMTP credentials and your AWS credentials are not the same. For
information about how to obtain your SMTP credentials, see Obtaining Your Amazon SES
SMTP Credentials (p. 57).
[email-smtp.us-west-2.amazonaws.com]:25 USERNAME:PASSWORD
At a command prompt, issue the following command to create a hashmap database file containing
your SMTP credentials.
sudo postmap hash:/etc/postfix/sasl_passwd
7.
8.
9.
Tell Postfix where to find the CA certificate (needed to verify the Amazon SES server certificate).
You could use a self-signed certificate or you could use default certificates as follows:
If running on the Amazon Linux AMI:
sudo postconf -e 'smtp_tls_CAfile = /etc/ssl/certs/ca-bundle.crt'
10. When you have finished updating the configuration, stop and start Postfix by typing the following at
the command line:
sudo postfix stop
sudo postfix start
11. Send a test email by typing the following at a command line, pressing Enter after each line. Note
that you must replace [email protected] with your "From" email address, which you must have
previously verified with Amazon SES. Replace [email protected] with your "To" address. If your
account is still in the sandbox, the "To" address must also be verified. Also note that the final line
is a single period.
sendmail -f [email protected] [email protected]
From: [email protected]
Subject: Test
This email was sent through Amazon SES!
.
12. Check your inbox for the email. If the message was not delivered, check your Junk box, and then
check your system's mail log (typically /var/log/maillog) for errors. For example, you will get an
"Email address not verified" error if you have not verified the "From" address that follows "-f" on the
command line.
To begin, you will need to set up a secure tunnel as described in Setting Up a Secure Tunnel to
Connect to Amazon SES (p. 68). In the following procedure, we use port 2525 as your stunnel
port. If you are using a different port, modify the settings that you actually use accordingly.
2.
On your mail server, open the main.cf file. On many systems, this file resides in the /etc/postfix
folder.
3.
On your mail server, open the master.cf file. On many systems, this file resides in the /etc/postfix
folder.
5.
Comment out the following line of the master.cf file by putting a # in front of it: -o
smtp_fallback_relay=
Save and close the master.cf file.
6.
Edit the /etc/postfix/sasl_passwd file. If the file does not exist, create it. Add the following line to
the file, replacing USERNAME and PASSWORD with your SMTP user name and password.
Important
Use your SMTP user name and password, not your AWS access key ID and secret
access key. Your SMTP credentials and your AWS credentials are not the same. For
API Version 2010-12-01
71
information about how to obtain your SMTP credentials, see Obtaining Your Amazon SES
SMTP Credentials (p. 57).
127.0.0.1:2525 USERNAME:PASSWORD
At a command prompt, issue the following command to create a hashmap database file containing
your SMTP credentials.
sudo postmap hash:/etc/postfix/sasl_passwd
8.
9.
10. When you have finished updating the configuration, stop and start Postfix by typing the following at
the command line:
sudo postfix stop
sudo postfix start
11. Send a test email by typing the following at a command line, pressing Enter after each line. Note
that you must replace [email protected] with your "From" email address, which you must have
previously verified with Amazon SES. Replace [email protected] with your "To" address. If your
account is still in the sandbox, the "To" address must also be verified. Also note that the final line
is a single period.
sendmail -f [email protected] [email protected]
From: [email protected]
Subject: Test
This email was sent through Amazon SES!
.
12. Check your inbox for the email. If the message was not delivered, check your Junk box, and then
check your system's mail log (typically /var/log/maillog) for errors. For example, you will get an
"Email address not verified" error if you have not verified the "From" address that follows "-f" on the
command line.
Note
To see if a package is installed on a computer running Red Hat Linux, type rpm -qa |
grep <package>, where <package> is the package name. To see if a package is
installed on a computer running Ubuntu Linux, type dpkg -s <package>.
In addition to the Sendmail package, the following packages are installed on your computer:
sendmail-cf, m4, and cyrus-sasl-plain.
You have verified your "From" address and, if your account is still in the sandbox, you have also
verified your "To" addresses. For more information, see Verifying Email Addresses in Amazon
SES (p. 39).
(Optional) If you are sending email through Amazon SES from an Amazon EC2 instance, you may
need to assign an Elastic IP Address to your Amazon EC2 instance for the receiving ISP to accept
your email. For more information, see Amazon EC2 Elastic IP Addresses.
(Optional) If you are sending email through Amazon SES from an Amazon EC2 instance, you
can fill out a Request to Remove Email Sending Limitations to remove the additional sending limit
restrictions that are applied to port 25 by default.
To configure Sendmail to send email through the Amazon SES endpoint in US West
(Oregon) using STARTTLS
1.
Open the /etc/mail/authinfo file for editing. If the file does not exist, create it.
Important
These instructions assume that you want to use Amazon SES in the US West (Oregon)
AWS region. If you want to use a different region, replace all instances of email-smtp.uswest-2.amazonaws.com in these instructions with the SMTP endpoint of the desired
region. For a list of SMTP endpoints, see Regions and Amazon SES (p. 332).
2.
If Sendmail cannot authenticate with the Amazon SES SMTP endpoint because the hostname
does not match, try adding the additional line specified in Amazon SES SMTP Issues (p. 238).
API Version 2010-12-01
73
3.
4.
5.
Open the /etc/mail/access file and include support for relaying to the Amazon SES SMTP endpoint
by adding the following line. If Sendmail cannot authenticate with the Amazon SES SMTP
endpoint because the hostname does not match, try adding the additional line specified in Amazon
SES SMTP Issues (p. 238).
Connect:email-smtp.us-west-2.amazonaws.com RELAY
7.
8.
Add the following group of lines to the /etc/mail/sendmail.mc file before any MAILER() definitions.
If you add a FEATURE() line after a MAILER() definition, when you run m4 in a subsequent step,
you will get the following error: "ERROR: FEATURE() should be before MAILER().":
Important
If you are using an AWS region other than US West (Oregon), replace the SMART_HOST
value with the Amazon SES SMTP endpoint of the region you're using, and be sure to
use the ` character and the apostrophe exactly as shown.
define(`SMART_HOST', `email-smtp.us-west-2.amazonaws.com')dnl
define(`RELAY_MAILER_ARGS', `TCP $h 25')dnl
define(`confAUTH_MECHANISMS', `LOGIN PLAIN')dnl
FEATURE(`authinfo', `hash -o /etc/mail/authinfo.db')dnl
MASQUERADE_AS(`YOUR_DOMAIN')dnl
FEATURE(masquerade_envelope)dnl
FEATURE(masquerade_entire_domain)dnl
9.
In the text you just added to sendmail.mc, in the line that starts with MASQUERADE_AS, replace
YOUR_DOMAIN with the domain name from which you are sending your email. By adding this
masquerade, you are making email from this host appear to be sent from your domain. Otherwise,
the email will appear as if the email is being sent from the host name of the mail server, and you
may get an "Email address not verified" error when you try to send an email.
Note
If you encounter errors such as "Command not found" and "No such file or directory,"
make sure you have installed the m4 and sendmail-cf packages as specified in the
prerequisites section above.
13. At a command prompt, type the following command to reset the permissions of sendmail.cf to read
only:
sudo chmod 644 /etc/mail/sendmail.cf
At a command prompt, type the following. Note that you should replace [email protected]
with your "From" email address, which you must have verified with Amazon SES. Replace
[email protected] with your "To" address. If your account is still in the sandbox, the "To"
address must also be verified.
sudo /usr/sbin/sendmail -f [email protected] [email protected]
2.
Press <Enter>. Type the body of the message, pressing <Enter> after each line.
3.
When you are finished typing the email, press CTRL+D to send the email.
16. Check the recipient email's client for the email. If you cannot find the email, check the Junk box in
the recipient's email client. If you still cannot find the email, look at the Sendmail log on the mail
server. The log is typically in /var/spool/mail/<user>.
To configure Sendmail to send email through Amazon SES using a secure tunnel
1.
To begin, you will need to set up a secure tunnel as described in Setting Up a Secure Tunnel to
Connect to Amazon SES (p. 68). In the following procedure, we use port 2525 as your stunnel
port. If you are using a different port, modify the settings that you actually use accordingly.
2.
Open the /etc/mail/authinfo file for editing. If the file does not exist, create it.
3.
4.
5.
6.
Open the /etc/mail/access file to ensure that relaying is allowed for 127.0.0.1. This is the default
behavior. If relaying is not allowed for localhost, open your /etc/hosts file and add another
hostname pointing to 127.0.0.1.
7.
If you modified /etc/mail/access in the last step, at a command prompt, type the following
command to regenerate /etc/mail/access.db:
sudo makemap hash /etc/mail/access.db < /etc/mail/access
8.
Open the /etc/mail/sendmail.mc file and add the following group of lines before any MAILER()
definitions. If you add a FEATURE() line after a MAILER() definition, when you run m4 in a
subsequent step, you will get the following error: "ERROR: FEATURE() should be before
MAILER().":
Important
Be sure to use the ` character and the apostrophe exactly as shown.
API Version 2010-12-01
75
9.
In the text you just added to sendmail.mc, in the line that starts with MASQUERADE_AS, replace
YOUR_DOMAIN with the domain name from which you are sending your email. By adding this
masquerade, you are making email from this host appear to be sent from your domain. Otherwise,
the email will appear as if the email is being sent from the host name of the mail server, and you
may get an "Email address not verified" error when you try to send an email.
Also, if you found in Step 5 that relaying was not allowed for 127.0.0.1, change the
`SMART_HOST' line you added to sendmail.mc to use the hostname that you entered in the /etc/
hosts file. That is:
define(`SMART_HOST', `hostname')dnl
Note
If you encounter errors such as "Command not found" and "No such file or directory,"
make sure you have installed the m4 and sendmail-cf packages as specified in the
prerequisites section.
13. At a command prompt, type the following command to reset the permissions of sendmail.cf to read
only:
sudo chmod 644 /etc/mail/sendmail.cf
At a command prompt, type the following. Note that you should replace [email protected]
with your "From" email address, which you must have verified with Amazon SES. Replace
[email protected] with your "To" address. If your account is still in the sandbox, the "To"
address must also be verified.
sudo /usr/sbin/sendmail -f [email protected] [email protected]
2.
Press <Enter>. Type the body of the message, pressing <Enter> after each line.
3.
When you are finished typing the email, press CTRL+D to send the email.
16. Check the recipient email's client for the email. If you cannot find the email, check the Junk box in
the recipient's email client. If you still cannot find the email, look at the Sendmail log on the email
sending computer. The log is typically in /var/spool/mail/<user>.
API Version 2010-12-01
76
Important
Follow only one of the following procedures (Microsoft Exchange GUI or Windows
PowerShell). If you follow both procedures, you will get an error stating that you have two
send connectors with the same name.
These instructions were written using Microsoft Exchange 2013.
To integrate Microsoft Exchange with Amazon SES using the Microsoft Exchange GUI
1.
2.
3.
4.
5.
6.
7.
Choose Next.
8.
9.
Choose the plus sign and then enter the Amazon SES endpoint that you will use (for example,
email-smtp.us-west-2.amazonaws.com). For a list of Amazon SES endpoints, see Regions and
Amazon SES (p. 332).
10. Choose Save. The endpoint you entered will appear in the SMART HOST box.
11. Choose Next.
12. Select Basic authentication, then select Offer basic authentication only after starting TLS,
and then enter your Amazon SES SMTP user name and password.
Important
Your SMTP user name and password are not the same as your AWS access key ID
and secret access key. Do not attempt to use your AWS credentials to authenticate
yourself against the SMTP endpoint. For more information about credentials, see Using
Credentials With Amazon SES (p. 323).
19. Verify that the servers are added and then choose finish.
You should now see a send connector for Amazon SES with an enabled status. All outbound mail
will now flow through Amazon SES.
Open the Exchange Management Shell and type $creds = Get-Credential. A Windows
PowerShell Credential Request dialog box will appear.
2.
In the dialog box, enter your Amazon SES SMTP user name and password and then choose OK.
Important
Your SMTP user name and password are not the same as your AWS access key ID
and secret access key. Do not attempt to use your AWS credentials to authenticate
yourself against the SMTP endpoint. For more information about credentials, see Using
Credentials With Amazon SES (p. 323).
3.
At the command prompt, type the following line, replacing ENDPOINT with an Amazon SES
SMTP endpoint (for example, email-smtp.us-west-2.amazonaws.com). For a list of Amazon SES
endpoints, see Regions and Amazon SES (p. 332).
New-SendConnector -Name "SES" -AddressSpaces "*;1" -SmartHosts
"ENDPOINT" -SmartHostAuthMechanism BasicAuthRequireTLS -Usage Internet AuthenticationCredential $creds
The command line should now display a send connector for Amazon SES with an enabled status.
All outbound mail will now flow through Amazon SES.
To integrate the Microsoft Windows Server IIS SMTP server with Amazon SES
1.
2.
First, set up Microsoft Windows Server 2012 using the following instructions.
a.
From the Amazon EC2 management console, launch a new Microsoft Windows Server 2012
Base Amazon EC2 instance.
b.
Connect to the instance and log into it using Remote Desktop by following the instructions in
Getting Started with Amazon EC2 Windows Instances.
c.
d.
Install the Web Server role. Be sure to include the IIS 6 Management Compatibility tools
(an option under the Web Server checkbox).
e.
Next, configure the IIS SMTP service using the following instructions.
a.
b.
From the Tools menu, choose Internet Information Services (IIS) 6.0 Manager.
c.
d.
e.
f.
Under Single Computer, enter 127.0.0.1 for the IP address. You have now granted access
for this server to relay email to Amazon SES through the IIS SMTP service.
Note
In this procedure, we assume that your emails are generated on this server. If the
application that generates the email runs on a separate server, you need to grant
relaying access for that server in IIS SMTP.
3.
Finally, configure the server to send email through Amazon SES using the following instructions.
a.
b.
Return to the SMTP Virtual Server #1 Properties dialog box and then choose the Delivery
tab.
API Version 2010-12-01
On the Delivery tab, choose Outbound
82 Security.
c.
Select Basic Authentication and then enter your Amazon SES SMTP username and
password. You can obtain these credentials from the Amazon SES console using the
procedure in Obtaining Your Amazon SES SMTP Credentials (p. 57).
Important
Your SMTP user name and password are not the same as your AWS access key ID
and secret access key. Do not attempt to use your AWS credentials to authenticate
yourself against the SMTP endpoint. For more information about credentials, see
Using Credentials With Amazon SES (p. 323).
d.
e.
f.
g.
In the Outbound Connections dialog box, ensure that the port is 25 or 587.
h.
Choose Advanced.
i.
For the Smart host name, enter the Amazon SES endpoint that you will use (for example,
email-smtp.us-west-2.amazonaws.com). For a list of Amazon SES endpoints, see Regions
and Amazon SES (p. 332).
j.
k.
On the Server Manager Dashboard, right-click SMTP Virtual Server #1 and then restart the
service to pick up the new configuration.
l.
Send an email through this server. You can examine the message headers to confirm that it
was delivered through Amazon SES.
To configure integration with the Amazon SES US West (Oregon) endpoint using
STARTTLS
1.
Open the /etc/exim/exim.conf file for editing. If the file does not exist, create it.
Important
These instructions assume that you want to use Amazon SES in the US West (Oregon)
AWS region. If you want to use a different region, replace all instances of email-smtp.uswest-2.amazonaws.com in these instructions with the SMTP endpoint of the desired
region. For a list of SMTP endpoints, see Regions and Amazon SES (p. 332).
2.
In the routers section, after the begin routers line, add the following:
send_via_ses:
driver = manualroute
domains = ! +local_domains
transport = ses_smtp
route_list = * email-smtp.us-west-2.amazonaws.com;
b.
In the transports section, after the begin transports line, add the following:
ses_smtp:
driver = smtp
port = 25
API Version 2010-12-01
83
hosts_require_auth = $host_address
hosts_require_tls = $host_address
c.
In the authenticators section, after the begin authenticators line, add the following, replacing
USERNAME and PASSWORD with your SMTP user name and password:
Important
Use your SMTP user name and password, not your AWS access key ID and secret
access key. Your SMTP credentials and your AWS credentials are not the same. For
information about how to obtain your SMTP credentials, see Obtaining Your Amazon
SES SMTP Credentials (p. 57).
ses_login:
driver = plaintext
public_name = LOGIN
client_send = : USERNAME : PASSWORD
3.
To begin, you will need to set up a secure tunnel as described in Secure Tunnel (p. 62). In the
following procedure, we use port 2525 as your stunnel port. If you are using a different port, modify
the settings that you actually use accordingly.
2.
Open the /etc/exim/exim.conf file for editing. If the file does not exist, create it.
Important
These instructions assume that you want to use Amazon SES in the US West (Oregon)
AWS region. If you want to use a different region, replace all instances of email-smtp.uswest-2.amazonaws.com in these instructions with the SMTP endpoint of the desired
region. For a list of SMTP endpoints, see Regions and Amazon SES (p. 332).
3.
In the routers section, after the begin routers line, add the following:
send_via_ses:
driver = manualroute
domains = ! +local_domains
transport = ses_smtp
self = send
route_list = * localhost
b.
In the transports section, after the begin transports line, add the following:
ses_smtp:
driver = smtp
port = 2525
hosts_require_auth = localhost
hosts_avoid_tls = localhost
c.
In the authenticators section, after the begin authenticators line, add the following, replacing
USERNAME and PASSWORD with your SMTP user name and password:
ses_login:
driver = plaintext
public_name = LOGIN
client_send = : USERNAME : PASSWORD
4.
When you have finished updating the configuration, restart Exim. At the command line, type the
following command and press ENTER.
sudo /etc/init.d/exim restart
Note
This command may not be exactly the same on your particular server.
When you have completed this procedure, your outgoing email will be sent via Amazon SES. To test
your configuration, send an email message through your Exim server, and then verify that arrives at
its destination. If the message is not delivered, then check your system's mail log for errors. On many
systems, this is the /var/log/exim/main.log file.
This example shows how to connect to the Amazon SES SMTP endpoint in the US West (Oregon)
openssl s_client -crlf -quiet -connect email-smtp.us-west-2.amazonaws.com:465
Using
Example
Using
OpenSSL
Send Email
Using
Amazon
SES Some of the output in the
region TLS
and :Wrapper:
use
standard
SMTP to
commands
to send
an email
message.
example is omitted for brevity.
s_clientSpecifies that this connection will use TLS (SSL).
-crlfTranslates line feed characters (LF) to CR+LF (carriage return and line feed).
-quietInhibits printing of session and certificate information. This implicitly turns on -ign_eof as
well.
-connectSpecifies the SMTP host and port.
openssl s_client -crlf -quiet -starttls smtp -connect email-smtp.usUsing STARTTLS:
west-2.amazonaws.com:25
Note
For more information about SMTP, go to https://tools.ietf.org/html/rfc5321.
Note
The email address string must be 7-bit ASCII. If you want to send to or from email addresses
that contain unicode characters in the domain part of an address, you must encode the
domain using Punycode. For more information, see RFC 3492.
For an example of how to compose a formatted message using the AWS SDK for Java or the AWS
SDK for .NET, see Send an Email Through Amazon SES Using the AWS SDK for Java (p. 32) or Send
an Email Through Amazon SES Using the AWS SDK for .NET (p. 29), respectively.
For tips on how to increase your email sending speed when you make multiple calls to SendEmail,
see Increasing Throughput with Amazon SES (p. 237).
Using MIME
The SMTP protocol is designed for sending email messages composed of 7-bit ASCII characters.
While this works well for many use cases, it is insufficient for non-ASCII text encodings (such as
Unicode), binary content, or attachments. The Multipurpose Internet Mail Extensions standard (MIME)
was developed to overcome these limitations, making it possible to send many other kinds of content
using SMTP.
The MIME standard works by breaking the message body into multiple parts and then specifying what
is to be done with each part. For example, one part of an email message body might be plain text,
while another might be an image. In addition, MIME allows email messages to contain one or more
attachments. Message recipients can view the attachments from within their email clients, or they can
save the attachments.
The message header and content are separated by a blank line. Each part of the email is separated by
a boundary, a string of characters that denotes the beginning and ending of each part.
API Version 2010-12-01
88
TWFyeSBEYXZpcyAtICgzMjEpIDU1NS03NDY1DQpDYXJsIFRob21hcyAtICgzMjEpIDU1NS01MjM1
DQpTYW0gRmFycmlzIC0gKDMyMSkgNTU1LTIxMzQ=
--_003_97DCB304C5294779BEBCFC8357FCC4D2
MIME Encoding
Because of the 7-bit ASCII restriction of SMTP, any content containing 8-bit characters must first be
converted to 7-bit ASCII before sending. MIME defines a Content-Transfer-Encoding header field for
this purpose.
By convention, the most common encoding scheme is base64, where 8-bit binary content is encoded
using a well-defined set of 7-bit ASCII characters. Upon receipt, the email client inspects the ContentTransfer-Encoding header field, and can immediately perform a base64 decode operation on the
content, thus returning it to its original form. With most email clients, the encoding and decoding occur
automatically, and the user need not be aware of it.
In the example above, the "cust-serv.txt" attachment must be decoded from base64 format in order to
be read. Some email clients will encode all MIME parts in base64 format, even if they were originally
in plain text. This is not normally an issue, since email clients perform the encoding and decoding
automatically.
Note
For a list of MIME types that Amazon SES accepts, see Appendix: Unsupported Attachment
Types (p. 344).
If you want certain parts of a message, like some headers, to contain characters other than 7-bit ASCII,
then you must use MIME encoded-word syntax (RFC 2047) instead of a literal string. MIME encodedword syntax uses the following form: =?charset?encoding?encoded-text?=. For more information,
see RFC 2047. If you want to send to or from email addresses that contain unicode characters in the
domain part of an address, you must encode the domain using Punycode. For more information, see
RFC 3492.
API
The Amazon SES API provides the SendRawEmail action, which lets you compose and send an
email message in the format that you specify. For a complete description of SendRawEmail, go to the
Amazon Simple Email Service API Reference.
Note
For tips on how to increase your email sending speed when you make multiple calls to
SendRawEmail, see Increasing Throughput with Amazon SES (p. 237).
The message body must contain a properly formatted, raw email message, with appropriate header
fields and message body encoding. Although it is possible to construct the raw message manually
within an application, it is much easier to do so using existing mail libraries.
content.addBodyPart(attachment);
Amazon Simple Email Service Developer Guide
Using the API
For technical discussions about various Amazon SES topics, visit the Amazon SES Blog. To browse
and post questions, go to the Amazon SES Forum.
The other setup with which you can pass an SPF check is to configure Amazon SES to use your
own MAIL FROM domain, in which case you must publish an SPF record because the MAIL FROM
domain and the domain of the sending mail server, Amazon SES, are different. Instructions for
configuring your domain to send emails using a custom MAIL FROM domain are provided in Using a
Custom MAIL FROM Domain (p. 46).
To pass DMARC validation based on SPFIf you want DMARC validation to succeed based on
SPF, you must set up a custom MAIL FROM domain (p. 46) and publish an SPF record. Note that
the alignment mode in the DMARC policy must be relaxed, which is the default. For more information
about DMARC policies, see https://dmarc.org/.
Important
If you use "-all" as shown in the example, ISPs might block email from IP addresses that are
not listed in your SPF record. Your SPF record must therefore include every IP address that
you use to send email. As a debugging aid, you can use "~all" instead. When you use "~all",
ISPs will typically accept email from IP addresses that are not listed in the SPF record, but
they might flag it. To maximize deliverability, use "-all" and add a record for each IP address.
For examples of how to authorize multiple IP addresses, go to http://www.openspf.org/
SPF_Record_Syntax.
"v=spf1 include:amazonses.com -all"
To set up your domain so that Amazon SES automatically adds a DKIM signature to every message
sent from that domain, see Easy DKIM in Amazon SES (p. 94).
To add your own DKIM signature to any email that you send using the SendRawEmail API, see
Manual DKIM Signing in Amazon SES (p. 102).
Note
Amazon SES has endpoints in multiple AWS regions, and Easy DKIM setup applies to each
AWS region separately. You must perform the Easy DKIM setup procedure for each region in
which you want to use Easy DKIM. For information about using Amazon SES in multiple AWS
regions, see Regions and Amazon SES (p. 332).
This topic contains the following sections:
To set up Easy DKIM while you verify a new domain, see Setting Up Easy DKIM for a New
Domain (p. 94).
To set up Easy DKIM for an email address or domain that you have already verified, see Setting Up
Easy DKIM for an Existing Verified Identity (p. 97).
Go to your verified domain list in the Amazon SES console, or follow these instructions to navigate
to it:
a.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
b.
2.
3.
In the Verify a New Domain dialog box, enter your domain name, select the Generate DKIM
settings check box, and then click Verify This Domain.
In the resulting dialog box, you will see all of the DNS records that you need for setting up domain
verification and Easy DKIM. This information will also be available by clicking the domain name
after you close the dialog box.
4.
To complete domain verification, you must update your domain's DNS settings with the TXT record
information from the Domain Verification Record in the Verify a New Domain dialog box. Note
that some domain name providers use the term Host instead of Name. If your DNS provider does
API Version 2010-12-01
95
not allow underscores in record names, you can omit _amazonses from the Name of the domain
verification record. To help you easily identify this record within your domain's DNS settings, you
can optionally prefix the Value with amazonses:
Highlight and copy individual records, or select Download Record Set as CSV to download all of
the records.
Important
DNS providers may append the domain name to the end of DNS records. Adding a record
that already contains the domain name (such as _amazonses.example.com) may result
in the duplication of the domain name (such as _amazonses.example.com.example.com).
To avoid duplication of the domain name, add a period to the end of the domain name
in the DNS record. This will indicate to your DNS provider that the record name is fully
qualified (that is, no longer relative to the domain name), and prevent the DNS provider
from appending an additional domain name.
5.
To set up DKIM, you must update your domain's DNS settings with the CNAME record information
from the dialog box. Note that you cannot omit the underscore from _domainkey because the
underscore is required by RFC 4871.
Highlight and copy individual CNAME records, or select Download Record Set as CSV to
download all of the records.
a.
If Amazon Route 53 provides the DNS service for the domain you are verifying, and you are
logged in to Amazon SES console with the same email address and password you use for
Amazon Route 53, then you will have the option of immediately updating your DNS settings
for both domain verification and DKIM from within the Amazon SES console.
b.
If you are not using Amazon Route 53, you will need to update your DNS settings according
to the procedure established by your DNS service provider. (Ask your system administrator
if you are not sure who provides your DNS service.) Amazon Web Services will eventually
detect that you have updated your DNS records; this detection process may take up to 72
hours.
When verification is complete, the domain's Status in the Amazon SES console will change
from pending verification to verified, and you will receive an Amazon SES Domain Verification
SUCCESS confirmation email from Amazon Web Services. (AWS emails are sent to the email
address you used when you signed up for Amazon SES.)
When Amazon SES has successfully detected the changes to your DNS records, the DKIM
Verification Status for that domain in the Amazon SES console will change from in progress to
success, and you will receive an Amazon SES DKIM Setup Successful confirmation email from
Amazon Web Services.
6.
You can now use Amazon SES to send email that is signed using a DKIM signature from any valid
address in the verified domain. To send a test email using the Amazon SES console, check the
box next to the verified domain, and then click Send a Test Email. View the email headers in the
email you receive. Email providers typically provide this capability through an option such as Show
original or View message source. Look for a header named DKIM-Signature with the "d" tag set
to your domain. Note that when DKIM is enabled, there will be two DKIM-Signature headers added
to the message: one header for your domain, and one header with d=amazonses.com. (Amazon
SES adds a signature for amazonses.com automatically whether you have DKIM enabled or not.
You can ignore it.) For example, for a domain called ses-example.com, the DKIM signature header
you are looking for might look like:
h=From:To:Subject:MIME-Version:Content-Type:Content-TransferEncoding:Date:Message-ID;
bh=lcj/Sl5qKl6K6zwFUwb7Flgnngl892pW574kmS1hrS0=;
b=nhVMQLmSh7/DM5PW7xPV4K/PN4iVY0a5OF4YYk2L7jgUq9hHQlckopxe82TaAr64
eVTcBhHHj9Bwtzkmuk88g4G5UUN8J+AAsd/JUNGoZOBS1OofSkuAQ6cGfRGanF68Ag7
nmmEjEi+JL5JQh//u+EKTH4TVb4zdEWlBuMlrdTg=
Important
How you update the DNS settings depends on who provides your DNS service. DNS service
may be provided by a domain name registrar such as GoDaddy or Network Solutions, or by a
separate service such as Amazon Route 53.
What if Easy DKIM fails?
If your DNS settings are not correctly updated, you will first receive an Amazon SES DKIM FAILURE
email from Amazon Web Services, and you will see a status of failed in the Domains area when you
click on the DKIM tab.
Note
If this happens, Amazon SES will still send your email, but it will not be signed using a DKIM
signature.
Important
Easy DKIM only works with fully qualified domain names (FQDNs). If you wanted to set up
Easy DKIM for both example.com and newyork.example.com, you would need to set up Easy
DKIM for each of these FQDNs separately.
Go to your verified domain list in the Amazon SES console, or follow these instructions to navigate
to it:
a.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
b.
2.
In the content pane, click the verified domain for which you would like to set up Easy DKIM.
3.
4.
5.
To set up DKIM, you must update your domain's DNS settings with the displayed CNAME record
information. You can copy the records or click the Download Record Set as CSV link.
a.
If Amazon Route 53 provides the DNS service for the domain you are verifying, and you are
logged in to Amazon SES console with the same email address and password you use for
Amazon Route 53, then Amazon SES will give you the option of immediately updating your
DNS settings for Easy DKIM. If you would like to do this, click the Use Route 53 button.
Next, click Create Record Sets in the Use Route 53 dialog box to complete the process.
b.
If you are not using Amazon Route 53, you will need to update your DNS settings according
to the procedure established by your DNS service provider. (Ask your system administrator
if you are not sure who provides your DNS service.) Amazon Web Services will eventually
detect that you have updated your DNS records; this detection process may take up to 72
hours.
6.
When Amazon SES has successfully detected the changes to your DNS records, the DKIM
Verification Status for that domain in the Amazon SES console will change from in progress to
success, and you will receive an Amazon SES DKIM Setup Successful confirmation email from
Amazon Web Services. (Amazon Web Services emails are sent to the email address you used
when you signed up for Amazon SES.)
7.
(This step is only required if DKIM setup was initiated before 09-13-16, 2:00 PDT) To sign your
messages using a DKIM signature, you must enable Easy DKIM for the appropriate verified
sending identity as follows:
8.
a.
In the navigation pane, under Identities, click either Email Addresses or Domains,
depending whether you want to enable Easy DKIM signing for an email address or a domain.
b.
Click the email address or domain for which you wish to enable Easy DKIM signing.
c.
d.
You can now use Amazon SES to send email that is signed using a DKIM signature from any valid
address in the verified domain. To send a test email using the Amazon SES console, check the
box next to the verified domain, and then click Send a Test Email. View the email headers in the
email you receive. Email providers typically provide this capability through an option such as Show
original or View message source. Look for a header named DKIM-Signature with the "d" tag set
to your domain. Note that when DKIM is enabled, there will be two DKIM-Signature headers added
to the message: one header for your domain, and one header with d=amazonses.com. (Amazon
SES adds a signature for amazonses.com automatically whether you have DKIM enabled or not.
You can ignore it.) For example, for a domain called ses-example.com, the DKIM signature header
you are looking for might look like:
API Version 2010-12-01
99
Important
How you update the DNS settings depends on who provides your DNS service. DNS service
may be provided by a domain name registrar such as GoDaddy or Network Solutions, or by a
separate service such as Amazon Route 53.
What if Easy DKIM fails?
If your DNS settings are not correctly updated, you will first receive an Amazon SES DKIM FAILURE
email from Amazon Web Services, and you will see a status of failed in the Domains area when you
click on the DKIM tab.
Note
If this happens, Amazon SES will still send your email, but it will not be signed using a DKIM
signature.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
2.
In the navigation pane, under Identities, click either Email Addresses or Domains, depending
whether you want to disable Easy DKIM signing for an email address or a domain.
3.
Click the email address or domain for which you wish to disable Easy DKIM signing.
4.
5.
In the DKIM: field, click disable. Amazon SES will no longer DKIM-sign emails that you send from
this identity.
Note
If you do not see the disable option as in the figure below, then DKIM is already disabled.
Note
If you want to permanently disable DKIM signing from any email address on that domain, you
should also remove the CNAME records from your DNS.
Obtain the DKIM tokens for your domain. To do so, if you are using the Amazon SES API, call
VerifyDomainDkim to generate the tokens. If you already have a DKIM verified identity, call
GetIdentityDkimAttributes to obtain the tokens.
2.
In the output from the API, you will receive three DKIM tokens similar to the following:
vvjuipp74whm76gqoni7qmwwn4w4qusjiainivf6sf
3frqe7jn4obpuxjpwpolz6ipb3k5nvt2nhjpik2oy
wrqplteh7oodxnad7hsl4mixg2uavzneazxv5sxi2
3.
Use these tokens to construct three CNAME records. For a domain named example.com, the
records should appear similar to these:
vvjuipp74whm76gqoni7qmwwn4w4qusjiainivf6sf._domainkey.example.com CNAME
vvjuipp74whm76gqoni7qmwwn4w4qusjiainivf6sf.dkim.amazonses.com
3frqe7jn4obpuxjpwpolz6ipb3k5nvt2nhjpik2oy._domainkey.example.com CNAME
3frqe7jn4obpuxjpwpolz6ipb3k5nvt2nhjpik2oy.dkim.amazonses.com
wrqplteh7oodxnad7hsl4mixg2uavzneazxv5sxi2._domainkey.example.com CNAME
wrqplteh7oodxnad7hsl4mixg2uavzneazxv5sxi2.dkim.amazonses.com
You can now update your DNS with these records. Amazon Web Services will eventually detect that
you have updated your DNS records; this detection process may take up to 72 hours. Upon successful
detection, you will receive an Amazon SES DKIM Setup Successful confirmation email from Amazon
Web Services. (Amazon Web Services emails are sent to the email address you used when you signed
up for Amazon SES.)
Important
To ensure maximum deliverability, do not sign any of the following headers using a DKIM
signature:
Message-ID
Date
Return-Path
Bounces-To
API Version 2010-12-01
102
Note
If you are using the Amazon SES SMTP interface to send email, and your client software
automatically performs DKIM signing, you should check to ensure that your client does not
sign any of the headers listed above. We recommend that you check the documentation for
your software to find out exactly what headers are signed with DKIM.
For more information about the Amazon SES SMTP interface, see Using the Amazon SES
SMTP Interface to Send Email (p. 56).
bounces and complaints constitute abuse and put your Amazon SES sending abilities at risk of
suspension.
Note
To find how close you are to your sending limits, see Monitoring Your Sending
Limits (p. 193).
You monitor your Amazon SES sending in terms of email sending events. The email sending events
that you can monitor are:
Bounces The recipient's mail server permanently rejected the email. This event corresponds to
hard bounces. Soft bounces are only included when Amazon SES fails to deliver the email after
retrying for a period of time.
Complaints The recipient marked the email as spam.
Sends Your API call to Amazon SES was successful and Amazon SES will attempt to deliver the
email.
Rejects Amazon SES initially accepted the email, but later rejected it because the email contained
a virus.
Deliveries Amazon SES successfully delivered the email to the recipient's mail server.
You can monitor email sending events in three ways: using the console, using feedback notifications,
and using event publishing. The monitoring method you choose depends on the type of event you
want to monitor, the granularity and level of detail with which you want to monitor it, and where
you want Amazon SES to publish the data. You might choose to use multiple monitoring methods.
Characteristics of each method are listed in the following table.
Monitoring
Method
How to Access
the Data
Level of Detail
Granularity
Amazon SES
or CloudWatch
console or API
Bounces,
complaints,
deliveries, sends,
rejects
Amazon SES
or CloudWatch
console or API
(deliveries are
available through
CloudWatch only)
Count only
Coarse (across
entire AWS
account)
Feedback
notifications
Bounces,
complaints,
deliveries
Amazon SNS or
email (delivery
events are by
Amazon SNS
only)
Details on each
event
Coarse (across
entire AWS
account)
Event publishing
Bounces,
complaints,
deliveries, sends,
rejects
Amazon
CloudWatch or
Amazon Kinesis
Firehose
Details on each
event
Fine-grained
(based on userdefinable email
characteristics)
For information on how to use each monitoring method, see the following topics:
Monitoring Using the Amazon SES Console or API (p. 105)
Monitoring Using Notifications (p. 106)
Monitoring Using Event Publishing (p. 127)
For technical discussions about various Amazon SES topics, visit the Amazon SES Blog. To browse
and post questions, go to the Amazon SES Forum.
API Version 2010-12-01
104
1.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
2.
In the Navigation pane, click Sending Statistics. Your usage statistics are shown under Your
Amazon SES Metrics.
Note
The Deliveries graph corresponds to the number of emails you have sent.
3.
To view trend data for any metric, double-click the corresponding graph.
4.
Note
For a complete description of GetSendStatistics, go to the Amazon Simple Email Service
API Reference.
from [email protected] will use those settings. However, if you verify both example.com and
[email protected], [email protected] will not use the bounce notification settings that are
configured for example.com.
You must receive bounce and complaint notifications either by email or through Amazon
SNS The default method is by email, through a feature called email feedback forwarding. Delivery
notifications are optional and available only through Amazon SNS.
If you choose to receive notifications for all three types of events, then you might receive
multiple notifications for one email For example, the receiving mail server accepts the email
(triggering a delivery notification), but the recipient marks the email as spam, triggering a complaint
notification.
Before you start sending email, make sure that you set up a process to handle bounces
and complaints Your process needs to monitor bounces and complaints and to remove those
addresses from your mailing list. Excessive bounces and complaints put your Amazon SES account
at risk of termination. You will need to analyze each bounce and complaint message that you
receive to determine the cause. Bounces are usually caused by attempting to send to a nonexistent
recipient; complaints arise when recipients indicate that they do not want to receive your message. In
either case, we strongly recommend that you stop sending to these email addresses.
You can test notifications by using the Amazon SES mailbox simulator Emails that you send
to the mailbox simulator do not affect your bounce and complaint rates. For more information, see
Testing Amazon SES Email Sending (p. 224).
The following sections describe the notification methods:
To receive notifications by email (which applies to bounces and complaints only), see Amazon SES
Notifications Through Email (p. 107).
To receive notifications through Amazon SNS (which applies to all three notification types), see
Amazon SES Notifications Through Amazon SNS (p. 109).
Important
For several important points about notifications, see Monitoring Using Amazon SES
Notifications (p. 106).
The following sections describe how to receive bounce and complaint notifications through email:
To enable bounce and complaint notifications by email, see Enabling Email Feedback
Forwarding (p. 107).
To disable bounce and complaint notifications by email, see Disabling Email Feedback
Forwarding (p. 108).
To learn the email address to which bounce and complaint notifications are sent, see Email
Feedback Forwarding Destination (p. 109).
To enable bounce and complaint forwarding through email using the Amazon SES
console
1.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
2.
In the navigation pane, under Identity Management, choose Email Addresses or Domains,
depending on whether you want to configure bounce and complaint notifications for an email
address or domain.
3.
In the list of verified senders, choose the email address or domain for which you want to configure
bounce and complaint notifications.
4.
5.
6.
Note
Changes made to your settings on this page might take a few minutes to take effect.
You can also enable bounce and complaint notifications through email by using the
SetIdentityFeedbackForwardingEnabled API.
To disable bounce and complaint forwarding through email using the Amazon SES
console
1.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
2.
In the navigation pane, under Identity Management, choose Email Addresses or Domains,
depending on whether you want to configure bounce and complaint notifications for an email
address or domain.
3.
In the list of verified senders, choose the email address or domain for which you want to configure
bounce and complaint notifications.
4.
5.
6.
In the Edit Notification Configuration dialog box, ensure that you have selected an Amazon SNS
topic for both bounces and complaints. Otherwise, you will not be able to disable email feedback
forwarding in the next step.
7.
8.
Note
Changes made to your settings on this page might take a few minutes to take effect.
You can also disable bounce and complaint notifications through email by using the
SetIdentityFeedbackForwardingEnabled API.
Important
Regardless of whether you use the SMTP interface, SendEmail API, or SendRawEmail API,
Amazon SES overwrites any Return-Path: header that you provide.
Important
For several important points about notifications, see Monitoring Using Amazon SES
Notifications (p. 106).
For information about Amazon SES bounce, complaint, and delivery notifications through Amazon
SNS, see the following sections:
To set up notifications using the Amazon SES console or the Amazon SES API, see Configuring
Amazon SNS Notifications for Amazon SES (p. 110).
For a description of the contents of a notification, see Amazon SNS Notification Contents for Amazon
SES (p. 111).
For examples of bounce, complaint, and delivery notifications, see Amazon SNS Notification
Examples for Amazon SES (p. 120).
API Version 2010-12-01
109
Important
For several important points about notifications, see Monitoring Using Amazon SES
Notifications (p. 106).
You can configure notifications by using the Amazon SES console or by using the Amazon SES API,
as described in the following sections.
To configure notifications by using the Amazon SES console, see Configuring Notifications Using the
Amazon SES Console (p. 110).
To configure notifications by using the Amazon SES API, see Configuring Notifications Using the
Amazon SES API (p. 111).
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/
2.
In the navigation pane, under Identity Management, choose Domains or Email Addresses.
3.
In the list of verified senders, choose the email address or domain for which you want to configure
notifications.
Important
Verified domain notification settings apply to all mail sent from email addresses in that
domain except for email addresses that are also verified.
4.
5.
6.
Under SNS Topic Configuration, you can edit the Amazon SNS topic configuration as follows:
a.
Choose the Amazon SNS topics you want to use for bounces, complaints, and/or deliveries.
You can choose to publish notifications to the same Amazon SNS topic or to different Amazon
SNS topics.
Important
The Amazon SNS topics you use for bounce, complaint, and delivery notifications
must be within the same AWS region in which you are using Amazon SES.
If you want to use an Amazon SNS topic that you do not own, you must configure your AWS
Identity and Access Management (IAM) policy to allow publishing from the Amazon Resource
Name (ARN) of the Amazon SNS topic.
b.
If you want the Amazon SNS notifications to contain the original headers of the emails you
pass to Amazon SES, choose Include original headers. This option is only available if you
have assigned an Amazon SNS topic to the associated notification type. For information about
the contents of the original email headers, see the mail object in Amazon SNS Notification
Contents (p. 111).
7.
If you choose Amazon SNS topics for both bounces and complaints, you can disable email
notifications entirely. To disable email notifications for bounces and complaints, under Email
Feedback Forwarding, choose Disable. Delivery notifications are available only through Amazon
SNS.
8.
Choose Save Config. The changes you made to your notification settings might take a few
minutes to take effect.
API Version 2010-12-01
110
After you configure your settings, you will start receiving bounce, complaint, and/or delivery
notifications to your Amazon SNS topic(s). These notifications will be in JavaScript Object Notation
(JSON) format and will follow the structure described in Amazon SNS Notification Contents (p. 111).
You will be charged standard Amazon SNS rates for bounce, complaint, and delivery notifications. For
more information, see the Amazon SNS pricing page.
Note
If an attempt to publish to your Amazon SNS topic fails because the topic has been deleted or
your AWS account no longer has permissions to publish to it, the Amazon SES configuration
for that topic for the sending identity will be deleted, bounce and complaint notifications
through email will be re-enabled for that identity, and you will be notified of the change through
email. If you have multiple identities configured to use that topic, each identity will have its
topic configuration changed when each identity experiences a failure to publish to that topic.
the email, the receiving mail server might determine that the email actually results in a bounce
(triggering a bounce notification). However, these will always be separate notifications because they
are different notification types.
Amazon SES reserves the right to add additional fields to the notifications. As such, applications that
parse these notifications must be flexible enough to handle unknown fields.
Amazon SES overwrites the headers of the message when it sends the email. You can retrieve the
headers of the original message from the headers and commonHeaders fields of the mail object.
Description
notificationType
bounce
complaint
delivery
Mail Object
Each bounce, complaint, or delivery notification contains information about the original email in the
mail object. The JSON object that contains information about a mail object has the following fields.
Field Name
Description
timestamp
messageId
Note
This message ID was assigned
by Amazon SES. You can find the
message ID of the original email in the
API Version 2010-12-01
112
Field Name
Description
headers and commonHeaders fields of
the mail object.
source
sourceArn
sendingAccountId
destination
headersTruncated
headers
Note
Any message ID within the headers
field is from the original message
that you passed to Amazon SES.
The message ID that Amazon SES
subsequently assigned to the message
is in the messageId field of the mail
object.
commonHeaders
Note
Any message ID within the
commonHeaders field is from the
original message that you passed to
Amazon SES. The message ID that
Amazon SES subsequently assigned to
the message is in the messageId field
of the mail object.
The following is an example of a mail object that includes the original email headers. When this
notification type is not configured to include the original email headers, the mail object does not
include the headersTruncated, headers, and commonHeaders fields.
{
"timestamp":"2016-01-27T14:05:45 +0000",
"messageId":"000001378603177f-7a5433e7-8edb-42ae-af10f0181f34d6ee-000000",
"source":"[email protected]",
"sourceArn": "arn:aws:ses:us-west-2:888888888888:identity/example.com",
"sendingAccountId":"123456789012",
"destination":[
"[email protected]"
],
"headersTruncated":false,
"headers":[
{
"name":"From",
"value":"\"John Doe\" <[email protected]>"
},
{
"name":"To",
"value":"\"Jane Doe\" <[email protected]>"
},
{
"name":"Message-ID",
"value":"custom-message-ID"
},
{
"name":"Subject",
"value":"Hello"
},
{
"name":"Content-Type",
"value":"text/plain; charset=\"UTF-8\""
},
{
"name":"Content-Transfer-Encoding",
"value":"base64"
},
{
"name":"Date",
"value":"Wed, 27 Jan 2016 14:05:45 +0000"
}
],
"commonHeaders":{
"from":[
"John Doe <[email protected]>"
],
"date":"Wed, 27 Jan 2016 14:05:45 +0000",
"to":[
"Jane Doe <[email protected]>"
],
"messageId":" custom-message-ID",
"subject":"Hello"
}
}
Bounce Object
The JSON object that contains information about bounces will always have the following fields.
Field Name
Description
bounceType
bounceSubType
bouncedRecipients
timestamp
feedbackId
If Amazon SES was able to contact the remote Message Transfer Authority (MTA), the following field
will also be present.
Field Name
Description
remoteMtaIp
If a delivery status notification (DSN) was attached to the bounce, the following field may also be
present.
Field Name
Description
reportingMTA
{
"status":"4.0.0",
"action":"delayed",
"emailAddress":"[email protected]"
}
],
"reportingMTA": "example.com",
"timestamp":"2012-05-25T14:59:38.605Z",
"feedbackId":"000001378603176d-5a4b5ad9-6f30-4198-a8c3b1eb0c270a1d-000000",
"remoteMtaIp":"127.0.2.0"
}
Bounced Recipients
A bounce notification may pertain to a single recipient or to multiple recipients. The
bouncedRecipients field holds a list of objectsone per recipient to whom the bounce notification
pertainsand will always contain the following field.
Field Name
Description
emailAddress
Optionally, if a DSN is attached to the bounce, the following fields may also be present.
Field Name
Description
action
status
diagnosticCode
Bounce Types
The following bounce types are available. We recommend that you remove the email addresses that
have returned bounces marked Permanent from your mailing list, as we do not believe that you will
API Version 2010-12-01
116
be able to successfully send to them in the future. Transient bounces are sent to you when all retry
attempts have been exhausted and will no longer be retried. You may be able to successfully resend to
an address that initially resulted in a Transient bounce.
Note
Amazon SES only reports hard bounces and soft bounces that will no longer be retried by
Amazon SES. In other words, your recipient did not receive your email message, and Amazon
SES will not try to resend it.
bounceType
bounceSubType
Description
Undetermined Undetermined
Permanent
General
Permanent
NoEmail
Permanent
Suppressed
Transient
General
Transient
MailboxFull
Transient
MessageTooLarge
Transient
ContentRejected
Transient
AttachmentRejected
Complaint Object
The JSON object that contains information about complaints has the following fields.
Field Name
Description
complainedRecipients
timestamp
feedbackId
Further, if a feedback report is attached to the complaint, the following fields may be present.
Field Name
Description
userAgent
complaintFeedbackType
arrivalDate
The value of the Arrival-Date or ReceivedDate field from the feedback report (in ISO8601
format). This field may be absent in the report
(and therefore also absent in the JSON).
Complained Recipients
The complainedRecipients field contains a list of recipients that may have submitted the complaint.
Important
Since most ISPs redact the email address of the recipient who submitted the complaint from
their complaint notification, this list contains information about recipients who might have
sent the complaint, based on the recipients of the original message and the ISP from which
API Version 2010-12-01
118
we received the complaint. Amazon SES performs a lookup against the original message to
determine this recipient list.
JSON objects in this list contain the following field.
Field Name
Description
emailAddress
Note
Because of this behavior, you can be more certain that you know which email address
complained about your message if you limit your sending to one message per recipient (rather
than sending one message with 30 different email addresses in the bcc line).
Complaint Types
You may see the following complaint types in the complaintFeedbackType field as assigned by the
reporting ISP, according to the Internet Assigned Numbers Authority website:
abuseIndicates unsolicited email or some other kind of email abuse.
auth-failureEmail authentication failure report.
fraudIndicates some kind of fraud or phishing activity.
not-spamIndicates that the entity providing the report does not consider the message to be spam.
This may be used to correct a message that was incorrectly tagged or categorized as spam.
otherIndicates any other feedback that does not fit into other registered types.
virusReports that a virus is found in the originating message.
Delivery Object
The JSON object that contains information about deliveries will always have the following fields.
Field Name
Description
timestamp
processingTimeMillis
recipients
smtpResponse
reportingMTA
Field Name
Description
remoteMtaIp
"timestamp":"2016-01-27T14:59:38.237Z",
"source":"[email protected]",
"sourceArn": "arn:aws:ses:us-west-2:888888888888:identity/
example.com",
"sendingAccountId":"123456789012",
"messageId":"00000138111222aa-33322211-cccc-cccc-ccccddddaaaa0680-000000",
"destination":[
"[email protected]",
"[email protected]",
"[email protected]"],
"headersTruncated":false,
"headers":[
{
"name":"From",
"value":"\"John Doe\" <[email protected]>"
},
{
"name":"To",
"value":"\"Jane Doe\" <[email protected]>, \"Mary Doe\"
<[email protected]>, \"Richard Doe\" <[email protected]>"
},
{
"name":"Message-ID",
"value":"custom-message-ID"
},
{
"name":"Subject",
"value":"Hello"
},
{
"name":"Content-Type",
"value":"text/plain; charset=\"UTF-8\""
},
{
"name":"Content-Transfer-Encoding",
"value":"base64"
},
{
"name":"Date",
"value":"Wed, 27 Jan 2016 14:05:45 +0000"
}
],
"commonHeaders":{
"from":[
"John Doe <[email protected]>"
],
"date":"Wed, 27 Jan 2016 14:05:45 +0000",
"to":[
"Jane Doe <[email protected]>, Mary Doe <[email protected]>,
Richard Doe <[email protected]>"
],
"messageId":"custom-message-ID",
"subject":"Hello"
}
}
}
"value":"text/plain; charset=\"UTF-8\""
},
{
"name":"Content-Transfer-Encoding",
"value":"base64"
},
{
"name":"Date",
"value":"Wed, 27 Jan 2016 14:05:45 +0000"
}
],
"commonHeaders":{
"from":[
"John Doe <[email protected]>"
],
"date":"Wed, 27 Jan 2016 14:05:45 +0000",
"to":[
"Jane Doe <[email protected]>, Mary Doe <[email protected]>,
Richard Doe <[email protected]>"
],
"messageId":"custom-message-ID",
"subject":"Hello"
}
}
}
"sourceArn": "arn:aws:ses:us-west-2:888888888888:identity/
example.com",
"sendingAccountId":"123456789012",
"destination":[
"[email protected]",
"[email protected]",
"[email protected]"
],
"headersTruncated":false,
"headers":[
{
"name":"From",
"value":"\"John Doe\" <[email protected]>"
},
{
"name":"To",
"value":"\"Jane Doe\" <[email protected]>, \"Mary Doe\"
<[email protected]>, \"Richard Doe\" <[email protected]>"
},
{
"name":"Message-ID",
"value":"custom-message-ID"
},
{
"name":"Subject",
"value":"Hello"
},
{
"name":"Content-Type",
"value":"text/plain; charset=\"UTF-8\""
},
{
"name":"Content-Transfer-Encoding",
"value":"base64"
},
{
"name":"Date",
"value":"Wed, 27 Jan 2016 14:05:45 +0000"
}
],
"commonHeaders":{
"from":[
"John Doe <[email protected]>"
],
"date":"Wed, 27 Jan 2016 14:05:45 +0000",
"to":[
"Jane Doe <[email protected]>, Mary Doe <[email protected]>,
Richard Doe <[email protected]>"
],
"messageId":"custom-message-ID",
"subject":"Hello"
}
}
}
{
"name":"Date",
"value":"Wed, 27 Jan 2016 14:05:45 +0000"
}
],
"commonHeaders":{
"from":[
"John Doe <[email protected]>"
],
"date":"Wed, 27 Jan 2016 14:05:45 +0000",
"to":[
"Jane Doe <[email protected]>, Mary Doe <[email protected]>,
Richard Doe <[email protected]>"
],
"messageId":"custom-message-ID",
"subject":"Hello"
}
}
}
{
"name":"Content-Type",
"value":"text/plain; charset=\"UTF-8\""
},
{
"name":"Content-Transfer-Encoding",
"value":"base64"
},
{
"name":"Date",
"value":"Wed, 27 Jan 2016 14:58:45 +0000"
}
],
"commonHeaders":{
"from":[
"John Doe <[email protected]>"
],
"date":"Wed, 27 Jan 2016 14:58:45 +0000",
"to":[
"Jane Doe <[email protected]>"
],
"messageId":"custom-message-ID",
"subject":"Hello"
}
},
"delivery":{
"timestamp":"2016-01-27T14:59:38.237Z",
"recipients":["[email protected]"],
"processingTimeMillis":546,
"reportingMTA":"a8-70.smtp-out.amazonses.com",
"smtpResponse":"250 ok: Message 64111812 accepted",
"remoteMtaIp":"127.0.2.0"
}
}
Depending on which email sending interface you use, you either provide the message tag as a
parameter to the API call or as an Amazon SES-specific email header.
In addition to defining your own message tags, you can use message tags that Amazon SES
automatically provides. These are called auto-tags and they include the configuration set name, the
domain of the "From" address, the caller's outgoing IP address, the Amazon SES outgoing IP address,
and the IAM identity of the caller.
For technical discussions about various Amazon SES topics, visit the Amazon SES Blog. To browse
and post questions, go to the Amazon SES Forum.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
In the left navigation pane, choose Configuration Sets.
3.
4.
5.
For information about how to use the CreateConfigurationSet API to create a configuration set,
see the Amazon Simple Email Service API Reference.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
2.
3.
Choose a configuration set from the configuration set list. If the list is empty, you must first create a
configuration set (p. 129).
4.
For Add Destination, choose Select a destination type, and then choose CloudWatch.
5.
6.
For Event types, select at least one event type to publish to the event destination:
Send Your API call to Amazon SES was successful and Amazon SES will attempt to deliver
the email.
Reject Amazon SES initially accepted the email, but later rejected it because the email
contained a virus.
Bounce The recipient's mail server permanently rejected the email. This event corresponds to
hard bounces. Soft bounces are only included when Amazon SES fails to deliver the email after
retrying for a period of time.
Complaint The recipient marked the email as spam.
Delivery Amazon SES successfully delivered the email to the recipient's mail server.
7.
Select Enabled.
8.
For Value Source, choose Message Tag if you want Amazon SES to get the value of the
dimension from a message tag that you specified using an X-SES-MESSAGE-TAGS header or a
parameter to the API, or choose Email Header if you want Amazon SES to get the value of the
dimension from your own email headers.
9.
For Dimension Name, type a string to represent this email characteristic in CloudWatch.
Note
If you want to use an Amazon SES auto-tag, you must explicitly type the name of the
auto-tag as the Dimension Name. For more information, see Using Auto-Tags (p. 136).
10. For Default Value, type a default value for the dimension.
11. Choose Add Dimension to add dimensions, as needed.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
2.
3.
Choose a configuration set from the configuration set list. If the list is empty, you must first create a
configuration set (p. 129).
4.
For Add Destination, choose Select a destination type, and then choose Firehose.
5.
6.
For Event types, select at least one event type to publish to the event destination:
Send Your API call to Amazon SES was successful and Amazon SES will attempt to deliver
the email.
Reject Amazon SES initially accepted the email, but later rejected it because the email
contained a virus.
Bounce The recipient's mail server permanently rejected the email. This event corresponds to
hard bounces. Soft bounces are only included when Amazon SES fails to deliver the email after
retrying for a period of time.
Select Enabled.
8.
For Stream, choose an existing Firehose delivery stream, or choose Create new stream to create
a new one using the Firehose console.
For information about creating a stream using the Firehose console, see Creating an Amazon
Kinesis Firehose Delivery Stream in the Amazon Kinesis Firehose Developer Guide.
9.
For IAM role, choose an IAM role for which Amazon SES has permission to publish to Firehose on
your behalf. You can choose an existing role, have Amazon SES create a role for you, or create
your own role.
If you choose an existing role or create your own role, you must manually modify the role's policies
to give the role permission to access the Firehose delivery stream, and to give Amazon SES
permission to assume the role. For example policies, see Giving Amazon SES Permission to
Publish to Your Firehose Delivery Stream (p. 133).
Permissions Policy
The following permissions policy enables the role to publish data records to your Firehose delivery
stream.
API Version 2010-12-01
133
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
"Action": [
"firehose:PutRecordBatch"
],
"Resource": [
"arn:aws:firehose:region:ACCOUNT-ID:deliverystream/DELIVERYSTREAM-NAME "
]
},
]
}
Trust Policy
The following trust policy enables Amazon SES to assume the role.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
"Principal": {
"Service": "ses.amazonaws.com"
},
"Action": "sts:AssumeRole",
"Condition": {
"StringEquals": {
"sts:ExternalId": "ACCOUNT-ID"
}
}
}
]
}
SendEmail
API parameters
API Version 2010-12-01
134
SendRawEmail
Important
If you specify message tags using
both headers and API parameters,
Amazon SES uses only the message
tags provided by the API parameters.
Amazon SES does not join message
tags specified by API parameters and
headers.
SMTP interface
Amazon SES also provides a number of auto-tags that you can use without specifying message tags
when you sent the email. For more information, see Using Auto-Tags (p. 136).
The following sections describe how to specify the configuration set and message tags using headers
and using API parameters.
Using Amazon SES API Parameters (p. 135)
Using Amazon SES-Specific Email Headers (p. 135)
Using Custom Email Headers (p. 136)
Header
Configuration set
X-SES-CONFIGURATION-SET
Message tags
X-SES-MESSAGE-TAGS
The following example shows how the headers might look in a raw email that you submit to Amazon
SES.
X-SES-MESSAGE-TAGS: tagName1=tagValue1, tagName2=tagValue2
X-SES-CONFIGURATION-SET: myConfigurationSet
From: [email protected]
To: [email protected]
Subject: Subject
Content-Type: multipart/alternative;
API Version 2010-12-01
135
boundary="----=_boundary"
------=_boundary
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
body
------=_boundary
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit
body
------=_boundary--
Note
Header names and values that you use for Amazon SES event publishing must be in ASCII.
If you specify a non-ASCII header name or value for Amazon SES event publishing, the
email sending call will still succeed, but the event metrics will not be emitted to Amazon
CloudWatch.
Important
If you publish your events to Amazon CloudWatch and you want to use auto-tags, you must
explicitly define a dimension value for the auto-tags when you set up the CloudWatch event
destination (p. 130).
The following table shows the auto-tags that Amazon SES provides.
Auto-tag name
Description
ses:configuration-set
ses:caller-identity
ses:from-domain
ses:source-ip
ses:outgoing-ip
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
2.
For information about how to use the ListConfigurationSets API to list your configuration sets,
see the Amazon Simple Email Service API Reference.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
2.
3.
In the details pane, choose the expand icon next to the configuration set.
You will see the details of the configuration set.
For information about how to use the DescribeConfigurationSet API to describe a configuration
set, see the Amazon Simple Email Service API Reference.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
2.
3.
4.
From the Actions menu, choose Delete, and then confirm that you want to delete the
configuration set.
For information about how to use the DeleteConfigurationSet API to delete a configuration set,
see the Amazon Simple Email Service API Reference.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
2.
3.
In the configuration set list, choose the configuration set that contains the event destination that
you want to update.
4.
In the Destination list, to the right of the destination you want to edit, choose the edit icon (the
pencil).
5.
6.
To exit the Edit Configuration Set page, use the back button of your browser.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
2.
3.
In the configuration set list, choose the configuration set that contains the event destination that
you want to delete.
4.
5.
6.
To exit the Edit Configuration Set page, use the back button of your browser.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
In the left navigation pane, choose Configuration Sets.
In the configuration set list, choose the configuration set that contains the event destination that
you want to enable or disable.
4.
In the Destination list, to the right of the destination you want to edit, choose the edit icon (the
pencil).
5.
6.
To exit the Edit Configuration Set page, use the back button of your browser.
Available Metrics
The following metrics are available from Amazon SES.
Metric
Description
Bounce
Metric
Description
bounces are included only when Amazon SES fails to
deliver the email after retrying for a period of time.
Unit: count
Complaint
Delivery
Reject
Send
Available Dimensions
CloudWatch uses the dimension names that you specify when you add a CloudWatch event
destination to a configuration set in Amazon SES. For more information, see Set Up a CloudWatch
Event Destination for Amazon SES Event Publishing.
Sign in to the AWS Management Console and open the CloudWatch console at https://
console.aws.amazon.com/cloudwatch/.
2.
If necessary, change the region. From the navigation bar, select the region where your AWS
resources reside. For more information, see Regions and Endpoints.
3.
4.
In the All metrics pane, expand AWS Namespaces, and then choose SES.
5.
To view metrics across your entire AWS account, which Amazon SES publishes automatically,
choose Account Sending Metrics. To view fine-grained event publishing metrics (p. 127),
choose the combination of dimensions that you specified when you set up your CloudWatch event
destination (p. 130).
6.
Description
eventType
bounce
Field Name
Description
holds information about the bounce. For more
information, see Bounce Object (p. 143).
complaint
delivery
send
reject
Mail Object
Each email sending event record contains information about the original email in the mail object. The
JSON object that contains information about a mail object has the following fields.
Field Name
Description
timestamp
messageId
Note
This message ID was assigned
by Amazon SES. You can find the
message ID of the original email in the
headers and commonHeaders fields of
the mail object.
source
sourceArn
sendingAccountId
Field Name
Description
authorization, the sendingAccountId is the
delegate sender's account ID.
destination
headersTruncated
headers
Note
Any message ID within the headers
field is from the original message
that you passed to Amazon SES.
The message ID that Amazon SES
subsequently assigned to the message
is in the messageId field of the mail
object.
commonHeaders
Note
Any message ID within the
commonHeaders field is from the
original message that you passed to
Amazon SES. The message ID that
Amazon SES subsequently assigned to
the message is in the messageId field
of the mail object.
Bounce Object
The JSON object that contains information about a bounce event will always have the following fields.
Field Name
Description
bounceType
bounceSubType
bouncedRecipients
timestamp
Field Name
Description
which the bounce notification was sent by the
ISP, and not the time at which it was received by
Amazon SES.
feedbackId
Optionally, if a delivery status notification (DSN) was attached to the bounce, the following field may
also be present.
Field Name
Description
reportingMTA
Bounced Recipients
A bounce event may pertain to a single recipient or to multiple recipients. The bouncedRecipients
field holds a list of objects one object per recipient to whom the bounce event pertains and will
always contain the following field.
Field Name
Description
emailAddress
Optionally, if a DSN is attached to the bounce, the following fields may also be present.
Field Name
Description
action
status
diagnosticCode
Bounce Types
The following bounce types are available. We recommend that you remove the email addresses that
have returned bounces marked Permanent from your mailing list, as we do not believe that you will
be able to successfully send to them in the future. Transient bounces are sent to you when all retry
API Version 2010-12-01
144
attempts have been exhausted and will no longer be retried. You may be able to successfully resend to
an address that initially resulted in a Transient bounce.
Note
Amazon SES only reports hard bounces and soft bounces that will no longer be retried by
Amazon SES. In other words, your recipient did not receive your email message, and Amazon
SES will not try to resend it.
bounceType
bounceSubType
Description
Undetermined Undetermined
Permanent
General
Permanent
NoEmail
Permanent
Suppressed
Transient
General
Transient
MailboxFull
Transient
MessageTooLarge
Transient
ContentRejected
Transient
AttachmentRejected
Complaint Object
The JSON object that contains information about a complaint event has the following fields.
Field Name
Description
complainedRecipients
Field Name
Description
For more information, see Complained
Recipients (p. 146).
timestamp
feedbackId
Further, if a feedback report is attached to the complaint, the following fields may be present.
Field Name
Description
userAgent
complaintFeedbackType
arrivalDate
The value of the Arrival-Date or ReceivedDate field from the feedback report (in ISO8601
format). This field may be absent in the report
(and therefore also absent in the JSON).
Complained Recipients
The complainedRecipients field contains a list of recipients that may have submitted the complaint.
Important
Since most ISPs redact the email address of the recipient who submitted the complaint from
their complaint notification, this list contains information about recipients who might have
sent the complaint, based on the recipients of the original message and the ISP from which
we received the complaint. Amazon SES performs a lookup against the original message to
determine this recipient list.
JSON objects in this list contain the following field.
Field Name
Description
emailAddress
Complaint Types
You may see the following complaint types in the complaintFeedbackType field as assigned by the
reporting ISP, according to the Internet Assigned Numbers Authority website:
otherIndicates any other feedback that does not fit into other registered types.
virusReports that a virus is found in the originating message.
Delivery Object
The JSON object that contains information about a delivery event will always have the following
fields.
Field Name
Description
timestamp
processingTimeMillis
recipients
smtpResponse
reportingMTA
Send Object
The JSON object that contains information about a send event is always empty.
Reject Object
The JSON object that contains information about a reject event will always have the following fields.
Field Name
Description
reason
Bounce Record
The following is an example of a bounce event record that Amazon SES publishes to Firehose.
{
"eventType": "Bounce",
"bounce": {
"bounceType": "Permanent",
"bounceSubType": "General",
"bouncedRecipients": [
{
"emailAddress": "[email protected]",
"action": "failed",
"status": "5.1.1",
"diagnosticCode": "smtp; 550 5.1.1 user unknown"
}
],
"timestamp": "2016-10-14T05:02:52.574Z",
"feedbackId": "EXAMPLE7c1923f27ab0c24cb-5d9f-4e77-99b8-85e4cb3a33bb-000000",
"reportingMTA": "dsn; ses-example.com"
},
"mail": {
"timestamp": "2016-10-14T05:02:16.645Z",
"source": "[email protected]",
"sourceArn": "arn:aws:ses:us-east-1:123456789012:identity/
[email protected]",
"sendingAccountId": "123456789012",
"messageId": "EXAMPLE7c191be45-e9aedb9a-02f9-4d12-a87d-dd0099a07f8a-000000",
"destination": [
"[email protected]"
],
"headersTruncated": false,
"headers": [
{
"name": "From",
"value": "[email protected]"
},
{
"name": "To",
"value": "[email protected]"
},
{
"name": "Subject",
"value": "Email Subject"
},
{
"name": "MIME-Version",
"value": "1.0"
},
{
"name": "Content-Type",
"value": "multipart/mixed; boundary=\"---=_Part_0_716996660.1476421336341\""
},
{
API Version 2010-12-01
148
"name": "X-SES-MESSAGE-TAGS",
"value": "myCustomTag1=myCustomTagValue1, myCustomTag2=myCustomTagValue2"
}
],
"commonHeaders": {
"from": [
"[email protected]"
],
"to": [
"[email protected]"
],
"messageId": "EXAMPLE7c191be45-e9aedb9a-02f9-4d12-a87ddd0099a07f8a-000000",
"subject": "Email Subject"
},
"tags": {
"ses:configuration-set": [
"my-configuration-set"
],
"ses:source-ip": [
"192.0.2.0"
],
"ses:from-domain": [
"example.com"
],
"ses:caller-identity": [
"ses_user"
],
"myCustomTag1": [
"myCustomTagValue1"
],
"myCustomTag2": [
"myCustomTagValue2"
]
}
}
}
Complaint Record
The following is an example of a complaint event record that Amazon SES publishes to Firehose.
{
"eventType": "Complaint",
"complaint": {
"complainedRecipients": [
{
"emailAddress": "[email protected]"
}
],
"timestamp": "2016-10-14T17:48:17.365Z",
"feedbackId":
"01000157c44f053b-61b59c11-9236-11e6-8f96-7be8a4ae61bb-000000",
"userAgent": "Amazon SES Mailbox Simulator",
"complaintFeedbackType": "abuse",
"arrivalDate": "2016-10-14T17:48:17.584Z"
},
"mail": {
API Version 2010-12-01
149
"timestamp": "2016-10-14T17:48:02.777Z",
"source": "[email protected]",
"sourceArn": "arn:aws:ses:us-east-1:123456789012:identity/
[email protected]",
"sendingAccountId": "123456789012",
"messageId": "EXAMPLE7c191be45-e9aedb9a-02f9-4d12-a87d-dd0099a07f8a-000000",
"destination": [
"[email protected]"
],
"headersTruncated": false,
"headers": [
{
"name": "From",
"value": "[email protected]"
},
{
"name": "To",
"value": "[email protected]"
},
{
"name": "Subject",
"value": "Email Subject"
},
{
"name": "MIME-Version",
"value": "1.0"
},
{
"name": "Content-Type",
"value": "multipart/mixed; boundary=\"---=_Part_0_558624761.1476467282538\""
},
{
"name": "X-SES-MESSAGE-TAGS",
"value": "myCustomTag1=myCustomTagValue1, myCustomTag2=myCustomTagValue2"
}
],
"commonHeaders": {
"from": [
"[email protected]"
],
"to": [
"[email protected]"
],
"messageId": "EXAMPLE7c191be45-e9aedb9a-02f9-4d12-a87ddd0099a07f8a-000000",
"subject": "Email Subject"
},
"tags": {
"ses:configuration-set": [
"my-configuration-set"
],
"ses:source-ip": [
"192.0.2.0"
],
"ses:from-domain": [
"example.com"
],
"ses:caller-identity": [
API Version 2010-12-01
150
"ses_user"
],
"myCustomTag1": [
"myCustomTagValue1"
],
"myCustomTag2": [
"myCustomTagValue2"
]
}
}
}
Delivery Record
The following is an example of a delivery event record that Amazon SES publishes to Firehose.
{
"eventType": "Delivery",
"mail": {
"timestamp": "2016-10-19T23:20:52.240Z",
"source": "[email protected]",
"sourceArn": "arn:aws:ses:us-east-1:123456789012:identity/
[email protected]",
"sendingAccountId": "123456789012",
"messageId": "EXAMPLE7c191be45-e9aedb9a-02f9-4d12-a87d-dd0099a07f8a-000000",
"destination": [
"[email protected]"
],
"headersTruncated": false,
"headers": [
{
"name": "From",
"value": "[email protected]"
},
{
"name": "To",
"value": "[email protected]"
},
{
"name": "Subject",
"value": "Email Subject"
},
{
"name": "MIME-Version",
"value": "1.0"
},
{
"name": "Content-Type",
"value": "text/html; charset=UTF-8"
},
{
"name": "Content-Transfer-Encoding",
"value": "7bit"
}
],
"commonHeaders": {
"from": [
"[email protected]"
API Version 2010-12-01
151
],
"to": [
"[email protected]"
],
"messageId": "EXAMPLE7c191be45-e9aedb9a-02f9-4d12-a87ddd0099a07f8a-000000",
"subject": "Email Subject"
},
"tags": {
"ses:configuration-set": [
"my-configuration-set"
],
"ses:source-ip": [
"192.0.2.0"
],
"ses:from-domain": [
"example.com"
],
"ses:caller-identity": [
"ses_user"
],
"ses:outgoing-ip": [
"192.0.2.0"
],
"myCustomTag1": [
"myCustomTagValue1"
],
"myCustomTag2": [
"myCustomTagValue2"
]
}
},
"delivery": {
"timestamp": "2016-10-19T23:21:04.133Z",
"processingTimeMillis": 11893,
"recipients": [
"[email protected]"
],
"smtpResponse": "250 2.6.0 Message received",
"reportingMTA": "mta.example.com"
}
}
],
"headersTruncated": false,
"headers": [
{
"name": "From",
"value": "[email protected]"
},
{
"name": "To",
"value": "[email protected]"
},
{
"name": "Subject",
"value": "Email Subject"
},
{
"name": "MIME-Version",
"value": "1.0"
},
{
"name": "Content-Type",
"value": "multipart/mixed; boundary=\"---=_Part_0_716996660.1476421336341\""
},
{
"name": "X-SES-MESSAGE-TAGS",
"value": "myCustomTag1=myCustomTagValue1, myCustomTag2=myCustomTagValue2"
}
],
"commonHeaders": {
"from": [
"[email protected]"
],
"to": [
"[email protected]"
],
"messageId": "EXAMPLE7c191be45-e9aedb9a-02f9-4d12-a87ddd0099a07f8a-000000",
"subject": "Email Subject"
},
"tags": {
"ses:configuration-set": [
"my-configuration-set"
],
"ses:source-ip": [
"192.0.2.0"
],
"ses:from-domain": [
"example.com"
],
"ses:caller-identity": [
"ses_user"
],
"myCustomTag1": [
"myCustomTagValue1"
],
"myCustomTag2": [
"myCustomTagValue2"
]
API Version 2010-12-01
153
}
},
"send": {}
}
},
"tags": {
"ses:configuration-set": [
"my-configuration-set"
],
"ses:source-ip": [
"192.0.2.0"
],
"ses:from-domain": [
"example.com"
],
"ses:caller-identity": [
"ses_user"
],
"myCustomTag1": [
"myCustomTagValue1"
],
"myCustomTag2": [
"myCustomTagValue2"
]
}
},
"reject": {
"reason": "Bad content"
}
}
Prerequisites
For this tutorial, you will need the following:
An AWS account To access any web service that AWS offers, you must first create an AWS
account at https://aws.amazon.com/.
Verified email address To send emails using Amazon SES, you must verify your "From"
address or domain to show that you own it. If you are in the sandbox, you also must verify your "To"
addresses. You can verify email addresses or entire domains, but this tutorial requires a verified
email address so that you can send an email from the Amazon SES console, which is the simplest
way to send an email. For information about how to verify an email address, see Verifying Email
Addresses in Amazon SES (p. 39).
A SQL query tool Amazon Redshift does not provide or install any SQL client tools or libraries,
so you must install one that you can use to access the Amazon Redshift clusters that contain your
Amazon SES events. In this tutorial, we use SQL Workbench/J, a free, DBMS-independent, crossplatform SQL query tool. The following steps show you were to go to install it.
The following procedure shows how to install SQL Workbench/J.
2.
Go to the SQL Workbench/J website and download the appropriate package for your operating
system.
3.
Important
Note the Java runtime version prerequisites for SQL Workbench/J and ensure you are
using that version. Otherwise, this client application will not run.
4.
Go to Configure a JDBC Connection and download an Amazon Redshift JDBC driver to enable
SQL Workbench/J to connect to your cluster.
Next Step
Step 1: Create an Amazon Redshift Cluster (p. 156)
Important
The cluster that you deploy for this tutorial will run in a live environment. As long as it is
running, it will accrue charges to your AWS account. To avoid unnecessary charges, you
should delete your cluster when you are done with it. For pricing information, go to the
Amazon Redshift pricing page.
Next Step
Step 2: Connect to Your Amazon Redshift Cluster (p. 157)
API Version 2010-12-01
156
2.
3.
On the Configuration tab, under Cluster Database Properties, copy the JDBC URL of the
cluster.
Note
The endpoint for your cluster is not available until the cluster is created and in the
available state.
2.
3.
4.
In the New profile text box, type a name for the profile.
5.
6.
In the Manage Drivers dialog box, choose the Create a new entry button, and then add the driver
as follows.
a.
b.
c.
Navigate to the location of the driver you downloaded in Configure a JDBC Connection, select
the driver, and then choose Open.
d.
Choose OK.
You will be taken back to the Select Connection Profile dialog box.
7.
8.
For URL, paste the JDBC URL that you copied from the Amazon Redshift console.
9.
For Username, type the username that you chose when you set up the Amazon Redshift
cluster (p. 156).
10. For Password, type the password that you chose when you set up the Amazon Redshift cluster.
11. Select Autocommit.
12. To test the connection, choose Test.
Note
If the connection attempt times out, you might need to add your IP address to the security
group that allows incoming traffic from IP addresses. For more information, see The
Connection Is Refused or Fails in the Amazon Redshift Database Developer Guide.
13. On the top menu bar, choose the Save profile list button.
14. Choose OK.
SQL Workbench/J will connect to your Amazon Redshift cluster.
Next Step
Step 3: Create a Database Table (p. 159)
To access this information within your database, you must create a table. The following procedure
shows how to specify this information when you create the table in your database.
Note
We assume that SQL Workbench/J is currently open on your computer, and it is connected to
your Amazon Redshift cluster, as described in previous step (p. 157).
In SQL Workbench/J, copy the following code and paste it into the Statement 1 window.
create table ses (
message_id varchar(200) not null,
event_type varchar(20) not null,
sending_account_id char(12),
timestamp varchar(50),
destination text,
configuration_set text,
campaign text
);
2.
Place the cursor within the statement (somewhere before the semicolon), and then choose the
Execute current statement button, as shown in the following figure.
3.
In the Messages pane, verify that your table was successfully created.
Next Step
Step 4: Create a Firehose Delivery Stream (p. 161)
API Version 2010-12-01
160
Note
You must have already set up the Amazon Redshift cluster (p. 156), connected to your
cluster (p. 157), and created a database table (p. 159), as explained previous steps.
Sign in to the AWS Management Console and open the Firehose console at https://
console.aws.amazon.com/firehose/.
2.
3.
4.
Choose Next.
5.
On the Configuration page, leave the fields at the default settings for this simple tutorial. The
only step you must do is select an IAM role that enables Firehose to access your resources, as
explained in the following procedure.
a.
b.
In the drop-down menu, under Create/Update existing IAM role, choose Firehose delivery
IAM role.
You will be taken to the IAM console.
API Version 2010-12-01
161
c.
In the IAM console, leave the fields at their default settings, and then choose Allow.
You will return to the Firehose delivery stream set-up steps in the Firehose console.
6.
Choose Next.
7.
On the Review page, review your settings, and then choose Create Delivery Stream.
Create a JSONPaths file On your computer, create a file called jsonpaths.json. Copy the
following text into the file, and then save the file.
{
"jsonpaths": [
"$.mail.messageId",
"$.eventType",
"$.mail.sendingAccountId",
API Version 2010-12-01
162
"$.mail.timestamp",
"$.mail.destination",
"$.mail.tags.ses:configuration-set",
"$.mail.tags.campaign"
]
}
2.
Upload the JSONPaths file to the Amazon S3 bucket Go to the Amazon S3 console and
upload the file to the bucket you created when you set up the Firehose delivery stream in Creating
a Firehose Delivery Stream (p. 161).
3.
Set the COPY command in the Firehose delivery stream settings Now you have the
information you need to set the syntax of the COPY command that Amazon Redshift uses when it
puts your data in the table you created. The following procedure shows how to update the COPY
command information in the Firehose delivery stream settings.
1. Go to the Firehose console.
2. Under Redshift Delivery Streams, choose the Firehose delivery stream that you created for
Amazon SES event publishing.
3. On the Details page, choose Edit.
4. In the Redshift COPY options box, type the following text, replacing the following values with
your own values:
S3-BUCKET-NAME The name of the Amazon S3 bucket where Firehose places your
data for Amazon Redshift to access. You created this bucket when you set up your Firehose
delivery stream in Step 4: Create a Firehose Delivery Stream (p. 161). An example is mybucket.
REGION The region in which your Amazon SES, Firehose, Amazon S3, and Amazon
Redshift resources are located. An example is us-west-2.
json 's3://S3-BUCKET-NAME/jsonpaths.json' region 'REGION';
5. Choose Save.
Next Step
Step 5: Set up a Configuration Set (p. 164)
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
2.
3.
4.
Type a name for the configuration set, and then choose Create Configuration Set.
5.
Choose Close.
2.
For Add Destination, choose Select a destination type, and then choose Firehose.
3.
4.
5.
Select Enabled.
6.
For Stream, choose the delivery stream that you created in Step 4: Create a Firehose Delivery
Stream (p. 161).
7.
For IAM role, choose Let SES make a new role, and then type a name for the role.
8.
Choose Save.
9.
To exit the Edit Configuration Set page, use the back button of your browser.
Next Step
Step 6: Send Emails (p. 164)
Amazon SES console. You send the email to the Amazon SES mailbox simulator so that you can test
bounces, complaints, and other email sending outcomes.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
In the navigation pane of the Amazon SES console, under Identity Management, choose Email
Addresses.
3.
In the list of identities, select the check box of an email address that you have successfully verified
with Amazon SES (p. 39).
4.
5.
6.
For the To address, type an address from the Amazon SES mailbox simulator (p. 224), such as
[email protected] or [email protected].
7.
Copy and paste the following message in its entirety into the Message text box, replacing
CONFIGURATION-SET-NAME with the name of the configuration set you created in Step 5: Set up
a Configuration Set (p. 164), and replacing FROM-ADDRESS with the verified address you are
sending this email from.
X-SES-MESSAGE-TAGS: campaign=book
X-SES-CONFIGURATION-SET: CONFIGURATION-SET-NAME
Subject: Amazon SES Event Publishing Test
From: Amazon SES User <FROM-ADDRESS>
MIME-Version: 1.0
Content-Type: text/plain
This is a test message.
8.
9.
Next Step
Step 7: Query Email Sending Events (p. 165)
Note
We assume that SQL Workbench/J is currently open on your computer, and it is connected
to your Amazon Redshift cluster, as described in Step 2: Connect to Your Amazon Redshift
Cluster (p. 157).
To query email sending event data in Amazon Redshift from SQL Workbench/J
1.
To display all of your email sending records, copy the following query and paste it into the
Statement 1 window.
select * from ses;
2.
Place the cursor within the statement (somewhere before the semicolon), and then choose the
Execute current statement button.
You will see the email sending records for all of the emails you sent in Step 6: Send
Emails (p. 164). The records in the following figure show that our book campaign had two
complaints, and the clothing campaign had one bounce.
3.
To count the complaint records for the campaign of type book, copy the following query and
paste it into the Statement 1 window.
select count(*) as numberOfComplaint from ses where event_type =
'Complaint' and campaign like '%book%';
4.
Place the cursor within the statement (somewhere before the semicolon), and then choose the
Execute current statement button.
The results are the following, showing that the book campaign had two complaints.
Prerequisites
For this tutorial, you will need the following:
An AWS account To access any web service that AWS offers, you must first create an AWS
account at https://aws.amazon.com/.
Verified email address To send emails using Amazon SES, you must verify your "From"
address or domain to show that you own it. If you are in the sandbox, you also must verify your "To"
addresses. You can verify email addresses or entire domains, but this tutorial requires a verified
email address so that you can send an email from the Amazon SES console, which is the simplest
way to send an email. For information about how to verify an email address, see Verifying Email
Addresses in Amazon SES (p. 39).
Next Step
Step 1: Create an Amazon ES Cluster (p. 167)
Important
The cluster that you deploy for this tutorial will run in a live environment. As long as it is
running, it will accrue charges to your AWS account. To avoid unnecessary charges, you
should delete your cluster when you are done with it. For pricing information, go to the
Amazon Elasticsearch Service pricing page.
Sign in to the AWS Management Console and open the Amazon Elasticsearch Service console at
https://console.aws.amazon.com/es/.
2.
3.
4.
5.
6.
7.
8.
9.
Important
This setting simplifies testing but is not recommended for production environments.
For information about configuring access policies, see Configuring Access Policies in the
Amazon Elasticsearch Service Developer Guide.
10. Choose Next.
11. On the Review page, review your settings, and then choose Confirm and create.
Note
The cluster will take up to ten minutes to deploy.
Next Step
Step 2: Create a Firehose Delivery Stream (p. 168)
Note
You must have already set up an Amazon ES cluster, as explained in Step 1: Create an
Amazon ES Cluster (p. 167).
Sign in to the AWS Management Console and open the Firehose console at https://
console.aws.amazon.com/firehose/.
Choose Create Delivery Stream.
On the Destination page, choose the following options.
Destination Choose Amazon Elasticsearch Service.
Delivery stream name Type a name for the delivery stream.
Elasticsearch domain Choose the Amazon ES domain that you created in Step 1: Create an
Amazon ES Cluster (p. 167).
Index Type a name that you want to use to explore your email sending event data in Kibana.
You can choose any name, but let's use holiday-sale for this tutorial. An index is analogous
to a database. For example, if you want an easy way to access events from each of your email
campaigns separately, you can use a different Firehose stream and index for each campaign.
Index rotation Choose NoRotation.
Type Although this setting is not relevant to this tutorial, you must choose something, so type
events. A type is a logical category or partition of your index.
API Version 2010-12-01
168
Choose Next.
5.
On the Configuration page, leave the fields at the default settings. The only step you must do is
select an IAM role that enables Firehose to access your resources, as explained in the following
procedure.
a.
b.
In the drop-down menu, under Create/Update existing IAM role, choose Firehose delivery
IAM role.
You will be taken to the IAM console.
c.
In the IAM console, leave the fields at their default settings, and then choose Allow.
You will return to the Firehose delivery stream set-up steps in the Firehose console.
6.
Choose Next.
7.
On the Review page, review your settings, and then choose Create Delivery Stream.
Next Step
Step 3: Set up a Configuration Set (p. 169)
If you already have a configuration set, you can add a Firehose destination to your existing
configuration set. In this case, skip to Adding a Firehose Event Destination (p. 170).
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
2.
3.
4.
Type a name for the configuration set, and then choose Create Configuration Set.
5.
Choose Close.
2.
For Add Destination, choose Select a destination type, and then choose Firehose.
3.
4.
5.
Select Enabled.
6.
For Stream, choose the delivery stream that you created in Step 2: Create a Firehose Delivery
Stream (p. 168).
7.
For IAM role, choose Let SES make a new role, and then type a name for the role.
8.
Choose Save.
9.
To exit the Edit Configuration Set page, use the back button of your browser.
Next Step
Step 4: Send Emails (p. 170)
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
2.
In the Navigation pane of the Amazon SES console, under Identity Management, choose Email
Addresses.
API Version 2010-12-01
170
3.
4.
5.
In the list of identities, select the check box of an email address that you have successfully verified
with Amazon SES (p. 39).
Choose Send a Test Email.
In the Send Test Email dialog box, for Email Format, choose Raw.
6.
For the To address, type an address from the Amazon SES mailbox simulator (p. 224), such as
[email protected] or [email protected].
7.
Copy and paste the following message in its entirety into the Message text box, replacing
CONFIGURATION-SET-NAME with the name of the configuration set you created in Step 3: Set up
a Configuration Set (p. 169), and replacing FROM-ADDRESS with the verified address you are
sending this email from.
X-SES-MESSAGE-TAGS: campaign=book
X-SES-CONFIGURATION-SET: CONFIGURATION-SET-NAME
Subject: Amazon SES Event Publishing Test
From: Amazon SES User <FROM-ADDRESS>
MIME-Version: 1.0
Content-Type: text/plain
This is a test message.
8.
9.
Repeat this procedure a few times so that you generate multiple email sending events. For a few
of the emails, change the value of the campaign message tag to clothing to simulate sending
for a different email campaign.
Next Step
Step 5: Visualize Data in Kibana (p. 171)
Sign in to the AWS Management Console and open the Amazon Elasticsearch Service console at
https://console.aws.amazon.com/es/.
API Version 2010-12-01
171
2.
Under My Elasticsearch domains, choose the domain you created in Step 1: Create an Amazon
ES Cluster (p. 167).
3.
On the Configure an index pattern page, clear the Index contains time-based events check
box.
5.
Under Index name or pattern, verify that holiday-sale, the index you created in Step 1: Create
an Amazon ES Cluster (p. 167), is present. If it is not present, type holiday-sale* into the
field, and then choose Create.
Note
If the Create button does not appear, try adding an asterisk to the end of the index
pattern.
6.
7.
In the search box below the Discover tab, put the cursor after the asterisk (*), and then press
Enter.
Kibana will display a list of all of your email sending events.
2.
3.
Choose From a new search. If prompted for an index pattern, choose holiday-sale*.
4.
On the metrics pane, next to Y-Axis, ensure that the metric is set to Count.
5.
6.
For Aggregation, choose Terms. Terms refers to the fields in your JSON documents in your
index.
7.
For Field, under String, choose eventType. Leave the rest of the fields at their default values.
8.
Next to Options, choose the play button. Your bar chart comparing the event types will display on
the screen.
9.
To save your visualization, choose the save icon from the group of icons to the right of the search
bar.
10. Type a title such as All Event Types, and then choose Save.
Note
If the main window reports that there are zero search results, enter * in the search bar,
and then press Enter.
2.
In the left pane, under Available Fields, hover over eventType, and then choose the add button
that appears next to it.
3.
In the main window, hover over the eventType column heading, and then choose the arrow to sort
the event types by name.
The bounce events will move to the top of the list.
Note
There might be a short delay before the events are resorted.
4.
In the left pane, under Available Fields, hover over bounce.bouncedRecipients, and then
choose the add button that appears next to it.
In the main window, you will see the recipient address and bounce reason for each bounce event.
Prerequisites
For this tutorial, you will need the following:
An AWS account To access any web service that AWS offers, you must first create an AWS
account at https://aws.amazon.com/.
Verified email address To send emails using Amazon SES, you must verify your "From"
address or domain to show that you own it. If you are in the sandbox, you also must verify your "To"
addresses. You can verify email addresses or entire domains, but this tutorial requires a verified
email address so that you can send an email from the Amazon SES console, which is the simplest
way to send an email. For information about how to verify an email address, see Verifying Email
Addresses in Amazon SES (p. 39).
Next Step
Step 1: Set up a Configuration Set (p. 176)
If you already have a configuration set, you can add a CloudWatch destination to your existing
configuration set. In this case, skip to Adding a CloudWatch Event Destination (p. 177).
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
In the left navigation pane, choose Configuration Sets.
3.
4.
5.
Type a name for the configuration set, and then choose Create Configuration Set.
Choose Close.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
In the left navigation pane, choose Configuration Sets.
3.
4.
5.
6.
7.
8.
9.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
2.
In the Navigation pane of the Amazon SES console, under Identity Management, choose Email
Addresses.
3.
In the list of identities, select the check box of an email address that you have successfully verified
with Amazon SES (p. 39).
4.
5.
In the Send Test Email dialog box, for Email Format, choose Raw.
6.
For the To address, type an address from the Amazon SES mailbox simulator (p. 224), such as
[email protected] or [email protected].
7.
Copy and paste the following message in its entirety into the Message text box, replacing
CONFIGURATION-SET-NAME with the name of the configuration set you created in Step 3: Set up
a Configuration Set (p. 169), and replacing FROM-ADDRESS with the verified address you are
sending this email from.
X-SES-MESSAGE-TAGS: campaign=book
X-SES-CONFIGURATION-SET: CONFIGURATION-SET-NAME
Subject: Amazon SES Event Publishing Test
From: Amazon SES User <FROM-ADDRESS>
MIME-Version: 1.0
Content-Type: text/plain
This is a test message.
8.
9.
Repeat this procedure a few times so that you generate multiple email sending events. For a few
of the emails, change the value of the campaign message tag to clothing to simulate sending
for a different email campaign.
Next Step
Step 3: Graph Email Sending Events (p. 178)
2.
3.
4.
5.
Note
This tutorial requires that you have an application that can send a steady stream of emails
through Amazon SES. This requirement is explained in Prerequisites (p. 179).
The following sections walk you through the tutorial.
Prerequisites (p. 179)
Step 1: Create a Firehose Delivery Stream (p. 180)
Step 2: Set up a Configuration Set (p. 181)
Step 3: Send Emails (p. 182)
Step 4: Create an Amazon Kinesis Analytics Application (p. 182)
Step 5: Run a SQL Query (p. 187)
(Optional) Step 6: Save SQL Query Results (p. 188)
Prerequisites
For this tutorial, you need the following:
An AWS account To access any web service that AWS offers, you must first create an AWS
account at https://aws.amazon.com/.
Verified email address To send emails using Amazon SES, you must verify your "From"
address or domain to show that you own it. If you are in the sandbox, you also must verify your "To"
addresses. You can verify email addresses or entire domains, but this tutorial requires a verified
email address so that you can send an email from the Amazon SES console, which is the simplest
way to send an email. For information about how to verify an email address, see Verifying Email
Addresses in Amazon SES (p. 39).
Email application To use Amazon Kinesis Analytics as described in this tutorial, you must send
a steady stream of emails through Amazon SES so that you generate a steady stream of email
sending events. This enables Amazon Kinesis Analytics to automatically detect the schema and
then to process the event records with SQL. Sending one email every ten seconds for five minutes is
sufficient for this tutorial.
Important
If you do not have an existing email campaign to send to real recipients, we strongly
recommend that you send emails to an Amazon SES mailbox simulator (p. 224) address.
API Version 2010-12-01
179
Emails that you send to the mailbox simulator do not count toward your Amazon SES
bounce and complaint rates or your daily sending quota.
Next Step
Step 1: Create a Firehose Delivery Stream (p. 180)
Sign in to the AWS Management Console and open the Firehose console at https://
console.aws.amazon.com/firehose/.
2.
3.
4.
Choose Next.
5.
On the Configuration page, leave the fields at the default settings. The only required step is to
select an IAM role that enables Firehose to access your resources, as follows:
a.
b.
In the drop-down menu, under Create/Update existing IAM role, choose Firehose delivery
IAM role.
You are taken to the IAM console.
c.
In the IAM console, leave the fields at their default settings, and then choose Allow.
You return to the Firehose delivery stream set-up steps in the Firehose console.
6.
Choose Next.
7.
On the Review page, review your settings, and then choose Create Delivery Stream.
Next Step
Step 2: Set up a Configuration Set (p. 181)
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
2.
3.
4.
Type a name for the configuration set, and then choose Create Configuration Set.
5.
Choose Close.
2.
3.
For Add Destination, choose Select a destination type, and then choose Firehose.
For Name, type a name for the event destination.
4.
5.
Select Enabled.
6.
For Stream, choose the delivery stream that you created in Step 1: Create a Firehose Delivery
Stream (p. 180).
7.
For IAM role, choose Let SES make a new role, and then type a name for the role.
8.
9.
Choose Save.
To exit the Edit Configuration Set page, use the back button of your browser.
Next Step
Step 3: Send Emails (p. 182)
Next Step
Step 4: Create an Amazon Kinesis Analytics Application (p. 182)
Note
The email sending events of different event types (send, bounce, complaint, and delivery)
have different JSON schemas (p. 141). In a production environment, you might examine
several fields of this schema, but in this tutorial, we limit our examination to a small set of
fields that are present for all event types.
Start sending a steady stream of emails configured for event publishing through Amazon SES, and
continue sending the emails throughout this procedure. This is required so that Amazon Kinesis
Analytics can automatically detect the schema of the event records. Sending one email every
ten seconds for five minutes is sufficient for this tutorial. For more information, see Step 3: Send
Emails (p. 182).
After your email program has sent a few emails, move to the next step.
2.
Sign in to the AWS Management Console and open the Analytics console at https://
console.aws.amazon.com/kinesisanalytics.
3.
4.
Enter an application name and description, and then choose Save and continue.
5.
6.
Choose the Firehose stream you created in Step 2: Set up a Configuration Set (p. 181).
Amazon Kinesis Analytics attempts to discover the schema of the email sending event records
based on the incoming records. If Amazon Kinesis Analytics displays Error discovering input
schema, that means that Amazon Kinesis Analytics has not received any email sending records
yet. Choose Rediscover schema. You might need to choose this button several times. If schema
discovery does not succeed after several attempts, ensure that your email sending application is
steadily sending emails, and that the emails specify a configuration set.
When Amazon Kinesis Analytics detects a schema, it displays a success message and lists the
records it detected.
Important
Do not choose Save and continue. This will cause errors because the discovered
schema does not adhere to SQL naming constraints. You must edit the schema as
described in the next step.
7.
8.
For this tutorial, we remove most of the rows. Choose X next to all rows except rows with the
following column names:
eventType
timestamp
messageId
to
ses:configuration-set
Important
Do not choose Save schema and update stream samples. This will cause errors
because the discovered schema does not adhere to SQL naming constraints. You must
edit the schema as described in the next step.
9.
Examine the remaining entries under Column name and compare them to the SQL naming
requirements as follows:
Format As described in Identifiers in the Amazon Kinesis Analytics SQL Reference,
unquoted identifiers must start with a letter or underscore, and be followed by letters, digits, or
underscores. Amazon SES auto-tag names do not comply with these requirements because
they contain colons and dashes. You will edit these in the next step.
Reserved words Column names must not conflict with the SQL reserved words listed in
Reserved Words and Keywords in the Amazon Kinesis Analytics SQL Reference. Examples of
reserved keywords that conflict with Amazon SES event records are timestamp, value, date,
from, and to.
10. Edit the remaining column names to conform to the SQL requirements as follows:
Rename ses:configuration-set to ses_configuration_set.
Rename timestamp to ses_timestamp.
Rename to to ses_to.
11. Choose Save schema and update stream samples. If you encounter validation errors, ensure
that you correctly performed step 10. If you encounter the No rows in source stream error,
ensure that you are still sending the email stream that you started at the beginning of this
procedure, and then choose Retrieve rows. You might need to choose Retrieve rows several
times before Amazon Kinesis Analytics captures records.
12. Upon successful retrieval of rows, choose Exit (done).
Next Step
Step 5: Run a SQL Query (p. 187)
Important
This procedure requires that you continue to send a steady stream of emails configured for
event publishing through Amazon SES, as described in Step 3: Send Emails (p. 182).
Assuming that you have moved on to this procedure after completing the last step (p. 182), go to
the Amazon Kinesis Analytics console top menu and choose your application.
2.
3.
4.
Next Step
(Optional) Step 6: Save SQL Query Results (p. 188)
Set up a new Firehose stream that uses Amazon S3 as the destination. It is the same procedure
as Step 1: Create a Firehose Delivery Stream (p. 180).
2.
Go to the Amazon Kinesis Analytics console, choose the arrow next to your application, and then
choose Application details.
3.
4.
Choose the Firehose stream you created in step 1, leave the rest of the options at their default
settings, and then choose Save and continue.
In several seconds, you return to the main page of the application.
API Version 2010-12-01
189
5.
6.
Choose Save and run SQL to re-run the query you ran in Step 5: Run a SQL Query (p. 187).
Amazon Kinesis Analytics attempts to process event data it receives from the Firehose delivery
stream. If you encounter the No rows have arrived yet error, ensure that you are still sending
emails so that Amazon Kinesis Analytics has email sending events to process.
As Amazon Kinesis Analytics processes records, results appear in the Real-time analytics tab.
Amazon Kinesis Analytics automatically saves the results to the Amazon S3 bucket that you
specified when you set up the Firehose delivery stream in step 1.
7.
8.
Choose the Amazon S3 bucket that is associated with the Firehose delivery stream that the
Amazon Kinesis Analytics application uses as its destination.
9.
Navigate to the data, which, by default, is organized in a folder hierarchy based on the date the
results are saved to the bucket.
If the bucket is empty, wait a few minutes and try again. It can take several minutes for data to get
from Amazon Kinesis Analytics to your Amazon S3 bucket.
10. Choose a file, and then from the Actions menu, choose Download.
11. Follow the on-screen instructions to download the file to your computer.
12. On your computer, open the file with a text editor. The records are in JSON format, and each
record is contained in curly braces. The following is an example of a file that contains two records.
{"eventType":"Send","ses_timestamp":"2016-12-08
18:51:12.092","messageId":"EXAMPLE8dfc6695c-5f048b74ca83-4052-8348-4e7da9669fc3-000000","ses_to":"[\"[email protected]
\" ]","ses_configuration_set":"[\"MyConfigSet\" ]"}
{"eventType":"Send","ses_timestamp":"2016-12-08
18:50:42.181","messageId":"EXAMPLEdfc5f485d40a2543-2cac-4b84-8a8f-30bebdf3820c-000000","ses_to":"[\"[email protected]
\" ]","ses_configuration_set":"[\"MyConfigSet\" ]"}
Note
The rate at which Amazon SES accepts your messages might be less than the maximum
send rate.
Your Amazon SES sending limits for each AWS region are separate. For information about using
Amazon SES in multiple AWS regions, see Regions and Amazon SES (p. 332).
When you are in the Amazon SES sandbox, your sending quota is 200 messages per 24-hour period
and your maximum sending rate is one message per second. To increase your sending limits, you
need to submit an SES Sending Limits Increase case. For more information, see Moving Out of the
Amazon SES Sandbox (p. 54). After you have moved out of the sandbox and start sending emails, you
can increase your sending limits further by submitting another SES Sending Limits Increase case, as
discussed in Increasing Your Amazon SES Sending Limits (p. 194).
Note
Sending limits are based on recipients rather than on messages. For example, an email
that has 10 recipients counts as 10 against your quota. However, we do not recommend
that you send an email to multiple recipients in one call to SendEmail because if the call to
Amazon SES fails (for example, the request is improperly formatted), the entire email will be
rejected and none of the recipients will get the intended email. We recommend that you call
SendEmail once for every recipient.
To increase your sending limits, see Increasing Your Amazon SES Sending Limits (p. 194).
For information about the errors your application receives when you reach your sending limits, see
What Happens When You Reach Your Amazon SES Sending Limits (p. 195).
To monitor your sending limits by using the Amazon SES console or the Amazon SES API, see
Monitoring Your Amazon SES Sending Limits (p. 193).
For technical discussions about various Amazon SES topics, visit the Amazon SES Blog. To browse
and post questions, go to the Amazon SES Forum.
Important
We recommend that you frequently check your sending statistics to ensure that you are
not close to your sending limits. If you are close to your sending limits, see Increasing Your
Amazon SES Sending Limits (p. 194) for information about how to increase them. Don't wait
until you reach your sending limits to consider increasing them.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
2.
In the Navigation pane, choose Sending Statistics. Your sending limits are shown under Your
Amazon SES Sending Limits.
3.
Note
For a complete description of GetSendQuota, go to the Amazon Simple Email Service API
Reference.
Important
Plan ahead. Be aware of your sending limits and try to stay within them. If you anticipate
needing a higher quota than the system has allocated automatically, please open an SES
Sending Limits Increase case well prior to the date that you need the higher quota.
Important
If you anticipate needing to send more than one million emails per day, you must open an
SES Sending Limits Increase case.
For Amazon SES to increase your quota, make sure that you use the following guidelines:
Send high-quality contentSend content that recipients want and expect. For recommendations
about how to send high-quality emails, see the Amazon Simple Email Service Email Sending Best
Practices whitepaper.
Send real production contentSend your actual production email. This enables Amazon SES to
accurately evaluate your sending patterns, and verify that you are sending high-quality content.
Send near your current quotaIf your volume stays close to your quota without exceeding it,
Amazon SES can detect this usage pattern and automatically increase your quota.
Have low bounce and complaint ratesTry to minimize the numbers of bounces and complaints.
Having high numbers of bounces and complaints can adversely affect your sending limits.
Important
Test emails that you send to your own email addresses may adversely affect your bounce
and complaint metrics, or appear as low-quality content to our filters. Whenever possible, use
the Amazon SES mailbox simulator to test your system. Emails that are sent to the mailbox
simulator do not count toward your sending metrics or your bounce and complaint rates. For
more information, see Testing Amazon SES Email Sending (p. 224).
For information about opening an SES Sending Limits Increase case, see Opening an SES Sending
Limits Increase Case (p. 194).
3.
Note
The rate at which Amazon SES accepts your messages might be less than the
maximum send rate.
New limit value: Enter the amount you are requesting. Be sure to only request the amount you
think you'll need. Keep in mind that you are not guaranteed to receive the amount you request,
and the higher the limit you request, the more justification you will need to be considered for that
amount.
Mail type Select Transactional, System Notifications, Subscription, Marketing, or Other.
Website URL Provide a link to your website. Although it isn't required, we highly recommend
that you provide one if you have it, because it helps us evaluate your request.
My email-sending complies with the AWS Service Terms and AWS Acceptable Use Policy
(AUP) Select Yes or No.
I only send to recipients who have specifically requested my mail Select Yes or No.
For tips on how to send high-quality mail and keep your recipient list clean, see Obtaining and
Maintaining Your Recipient List (p. 228) and the Amazon Simple Email Service Email Sending
Best Practices whitepaper.
I have a process to handle bounces and complaints. Select Yes or No. For information
on how to monitor and handle bounces and complaints, see Processing Bounces and
Complaints (p. 228).
Use Case Description Explain your situation in as much detail as possible. For example,
describe the type of emails you are sending and how email-sending fits into your business.
The more information you can provide that indicates that you are sending high-quality emails to
recipients who want and expect it, the more likely we are to approve your request. The higher
the limit value you are requesting, the more detail you should provide.
We will respond to the case after reviewing your request. Please allow one business day for
processing.
Note
You can send an email to multiple recipients as long as you have at least one email left before
you reach your sending rate limit. Then, you have to wait until you build up the corresponding
amount of sending rate quota before you can send again. For example, if your sending
API Version 2010-12-01
195
rate limit is one email per second, then you will be able to send an email with 10 recipients
once every 10 seconds. However, we do not recommend that you send an email to multiple
recipients in one call to SendEmail.
For a technique to use when you reach your maximum send rate, see How to handle a "Throttling
Maximum sending rate exceeded" error on the Amazon SES blog.
The way in which these errors are handled depends on the SMTP client that you use; some SMTP
clients may not display the error code at all.
Note
You can also control access to Amazon SES by using IAM policies. IAM policies constrain
what individual IAM users can do, while sending authorization policies constrain how individual
verified identities can be used. Further, only sending authorization policies can grant crossaccount access. For more information about using IAM policies with Amazon SES, see
Controlling Access to Amazon SES (p. 307).
For technical discussions about various Amazon SES topics, visit the Amazon SES Blog. To browse
and post questions, go to the Amazon SES Forum.
The following diagram shows the high-level relationship between sending authorization concepts:
Bounces and complaintsBounces and complaints count toward the delegate sender's bounce
and complaint metrics, and therefore the delegate sender's reputation as a sender.
DKIM signingIf the identity owner has enabled Easy DKIM signing for an identity, all email sent
from that identity will be DKIM-signed, including email sent by a delegate sender. Only the identity
owner has control of whether the emails are DKIM-signed.
NotificationsThe identity owner and the delegate sender set up their own Amazon SNS
notifications for bounces, complaints, and deliveries independently. However, feedback forwarding
by email is only available to the identity owner.
VerificationIdentity owners are responsible for following the procedure in Verifying Email
Addresses and Domains (p. 39) to verify that they own the email addresses and domains that
they are authorizing delegate senders to use. Delegate senders do not need to verify any email
addresses or domains specifically for sending authorization.
AWS regionsThe delegate sender must send the emails from the AWS region in which the
identity owner's identity is verified. The sending authorization policy that gives permission to the
delegate sender must be attached to the identity in that region.
Policy Structure
Each sending authorization policy is a JSON document that is attached to an identity. A policy includes:
Optional policy-wide information at the top of the document.
One or more individual statements, each of which describes one set of permissions.
Each statement includes the core information about a single permission. If a policy includes multiple
statements, Amazon SES applies a logical OR across the statements at evaluation time. Similarly, if
an identity has multiple policies attached to it, Amazon SES applies a logical OR across the policies at
evaluation time.
The following example shows a simple policy that allows AWS ID 123456789012 to send email from
the identity example.com (which is under account 888888888888) but only if the "From" address is
marketing+.*@example.com, where .* is any string that the sender wants to add after marketing+.
{
"Id": "SampleAuthorizationPolicy",
"Version": "2012-10-17",
"Statement": [
{
API Version 2010-12-01
199
"Sid": "AuthorizeMarketer",
"Effect": "Allow",
"Resource": "arn:aws:ses:us-east-1:888888888888:identity/example.com",
"Principal": {"AWS": ["123456789012"]},
"Action": ["SES:SendEmail", "SES:SendRawEmail"],
"Condition": {
"StringLike": {
"ses:FromAddress": "marketing+.*@example.com"
}
}
}
]
}
You can find more sending authorization policy examples at Sending Authorization Policy
Examples (p. 203).
Policy Elements
This section describes the elements contained in sending authorization policies. First we describe
policy-wide elements, and then we describe elements that apply only to the statement in which they are
included. We follow with a discussion of how to add conditions to your statements.
For specific information about the syntax of the elements, see Grammar of the IAM Policy Language in
the IAM User Guide.
Policy-Wide
There are two policy-wide elements: Id and Version. The following table provides information about
these elements.
Name
Description
Required
Valid Values
Id
No.
Any string
Version
No, but
as a best
practice, we
recommend
that you
include this
field with
a value of
"2012-10-17".
Any string
Statements
Sending authorization policies require at least one statement. Each statement can include the elements
described in the following table.
Name
Description
Required
Valid Values
Sid
No.
Any string.
Effect
No, although a
statement without an
effect is useless.
"Allow" or "Deny".
Name
Description
Required
Valid Values
statement to return at
evaluation time.
Resource
Yes.
An identity's ARN,
as specified in the
Amazon SES console.
Principal
Yes.
Action
Yes.
"ses:SendEmail",
"ses:SendRawEmail" (one
or both). If you use
the custom policy
editor, you can also
set the action to
"ses:*" to encompass
both APIs. If your
sender will access
Amazon SES through
the SMTP interface,
you must select
"ses:SendRawEmail"
at a minimum (or use
"ses:*").
Condition
Specifies any
restrictions or details
about the permission.
No.
Conditions
A condition is any restriction about the permission in the statement. The part of the statement that
specifies the conditions can be the most detailed of all the parts. A key is the specific characteristic that
is the basis for access restriction, such as the date and time of the request.
You use both conditions and keys together to express the restriction. For example, if you want to
restrict the delegate sender from making requests to Amazon SES on your behalf after July 30, 2015,
you use the condition called DateLessThan. You use the key called aws:CurrentTime and set it to
the value 2015-07-30T00:00:00Z.
You can use any of the AWS-wide keys listed at Available Keys in the IAM User Guide, or you can use
one of the following keys specific to Amazon SES:
Condition Key
Description
ses:Recipients
ses:FromAddress
ses:FromDisplayName
ses:FeedbackAddress
It is common to use the StringEquals and StringLike conditions with the Amazon SES keys.
These conditions are for case-sensitive string matching. For StringLike, the values can include a
multi-character match wildcard (*) or a single-character match wildcard (?) anywhere in the string.
For example, the following condition specifies that the delegate sender can only send from a "From"
address that starts with invoicing and ends with example.com:
"Condition": {
"StringLike": {
"ses:FromAddress": "invoicing+.*@example.com"
}
}
Note
When you want to disallow access to an email address, use wildcards to ensure that you
are completely preventing access to all forms of that address. For example, to disallow
sending from [email protected], you can prevent access to alternatives such as
"admin"@example.com and [email protected] by specifying the following condition:
"Condition": {
"StringNotLike": {
"ses:FromAddress": "*admin*.example.com"
}
}
For more information about how to specify conditions, see Condition in the IAM User Guide.
API Version 2010-12-01
202
Policy Requirements
Each policy must adhere to the following requirements:
Each policy must include at least one statement.
Each policy must include at least one valid principal.
Each policy must specify one resource, and that resource must be the ARN of the identity to which
the policy is attached.
Identity owners can associate up to 20 policies with each unique identity.
Policies must not exceed 4 kilobytes (KB).
Policy names cannot exceed 64 characters and can only include alphanumeric characters, dashes,
and underscores.
The following example policy grants permission to two IAM users to send from identity example.com.
IAM users are specified by their Amazon Resource Name (ARN).
API Version 2010-12-01
203
{
"Id": "ExampleAuthorizationPolicy",
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AuthorizeIAMUser",
"Effect": "Allow",
"Resource": "arn:aws:ses:us-east-1:888888888888:identity/example.com",
"Principal": {"AWS": [
"arn:aws:iam::111122223333:user/John",
"arn:aws:iam::444455556666:user/Jane"
]},
"Action": ["SES:SendEmail", "SES:SendRawEmail"]
}
]
}
The following example policy grants permission to Amazon Cognito to send from identity example.com.
{
"Id": "ExampleAuthorizationPolicy",
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AuthorizeService",
"Effect": "Allow",
"Resource": "arn:aws:ses:us-east-1:888888888888:identity/example.com",
"Principal": {"Service": ["cognito-idp.amazonaws.com"]},
"Action": ["SES:SendEmail", "SES:SendRawEmail"]
}
]
}
]
}
}
]
}
Note
If you want to enable the delegate sender to access Amazon SES through the SMTP
interface, you must choose SendRawEmail at a minimum.
If your use case is such that you want to restrict the action, you can do so by including only one of
the actions in your sending authorization policy. The following example shows you how to restrict the
action to SendRawEmail.
{
"Id": "ExamplePolicy",
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ControlAction",
"Effect": "Allow",
"Resource": "arn:aws:ses:us-east-1:888888888888:identity/example.com",
"Principal": {"AWS": ["123456789012"]},
"Action": ["SES:SendRawEmail"]
}
]
}
}
}
]
}
To see where these tasks fit into the overall sending authorization process, see Overview of Sending
Authorization (p. 197).
Verifying an Identity (p. 208)
Setting Up Notifications (p. 208)
Getting Information from the Delegate Sender (p. 208)
Creating a Policy (p. 208)
Providing the Delegate Sender with the Identity Information (p. 211)
Managing Your Policies (p. 211)
policy, or multiple policies. However, each policy must be associated with an identity, and one identity
only.
Important
Policies attached to email address identities override policies attached to the
corresponding domain identities. For example, say that you have verified example.com
and [email protected]. If you create a policy for example.com that disallows a delegate
sender, and you create a policy for [email protected] that allows that delegate sender,
the delegate sender will be able to send from [email protected] if they specify the ARN of
[email protected] in the request to send the email.
You can create a sending authorization policy in the following ways:
Using the Policy Generator You can create a simple policy by using the Policy Generator in
the Amazon SES console. In addition to specifying who can send the emails, you can constrain
the email-sending with conditions based on the time and date range in which emails can be sent,
the "From" address, the "From" display name, the address to which bounces and complaints are
sent, the recipient addresses, and the source IP. You might also want to use the Policy Generator to
create the structure of a simple policy and then customize it later by editing the policy.
Creating a Custom PolicyIf you want to include more advanced conditions or use an AWS
service as the principal, you can create a custom policy and attach it to the identity by using the
Amazon SES console or the Amazon SES API.
This topic describes both methods.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
2.
In the left navigation pane, under Identity Management, choose either Email Addresses or
Domains.
3.
In the resource list, choose the identity for which you want to create a policy.
4.
In the details pane, expand Identity Policies, choose Create Policy, and then choose Policy
Generator.
5.
In the wizard, create a policy statement by choosing values for the following fields. You can find
information about these options in Sending Authorization Policies (p. 199).
EffectIf you want to grant access, choose Allow; otherwise, choose Deny.
PrincipalsEnter either the 12-digit AWS account ID or the ARN of an IAM user that you are
allowing or denying access, and then choose Add. You can add more principals by repeating
this step. An example of an AWS account ID is 123456789012 and an example of an IAM user
ARN is arn:aws:iam::123456789012:user/John.
Note
The policy generator wizard does not currently support AWS service principals. To add
an AWS service principal, you must either create a custom policy (p. 211) or use the
policy generator to add an AWS account or IAM user principal, and then edit (p. 212)
the policy.
ActionsChoose the email-sending access to which this policy applies. Typically, identity
owners choose both options to give the delegate sender the freedom to choose how to
implement the email sending. For more information, see Statements (p. 200).
API Version 2010-12-01
209
6.
(Optional) If you want to add restrictions to the policy, choose Add Conditions, and then choose
the following information:
KeyThis is the characteristic that is the basis for access restriction. The Policy Generator
lets you choose an Amazon SES-specific key or one of a few commonly used AWS-wide keys
(current time and source IP). For details, see Conditions (p. 202). If you want to specify the
more advanced AWS-wide keys listed in Available Keys, you can edit the policy after you create
it.
ConditionThis is the type of condition that you want to specify. For example, there are string
conditions, numeric conditions, date and time conditions, and so on. For a list of conditions, see
Condition Types in the IAM User Guide.
ValueThis is the value that will be tested against the condition. For examples, see the policies
in Sending Authorization Policy Examples (p. 203).
After you choose the key, condition, and value, choose Add Condition. The condition appears in
the Conditions list. You can remove conditions by choosing Remove next to a condition in the
list. You can add another condition by choosing Add Conditions again.
7.
When you are finished adding conditions (if any), choose Add Statement. The statement appears
in the Statements list, where you can choose to edit or remove it. You can add additional
statements by repeating steps 5-7.
API Version 2010-12-01
210
8.
9.
In the Edit Policy dialog box, review your policy, edit it if needed, and then choose Apply Policy.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
2.
In the left navigation pane, under Identity Management, choose either Email Addresses or
Domains.
3.
In the resource list, choose the identity for which you want to create a policy.
4.
In the details pane, expand Identity Policies, choose Create Policy, and then choose Custom
Policy.
5.
In the Edit Policy pane, paste the text of your policy and edit it as necessary.
6.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
2.
In the left navigation pane, under Identity Management, choose either Email Addresses or
Domains.
3.
In the resource list, choose the identity to which you attached the sending authorization policy.
4.
At the top of the details pane, after Identity ARN, you will see the identity's ARN. It will look similar
to arn:aws:ses:us-east-1:123456789012:identity/[email protected]. Copy the entire ARN and
give it to your delegate sender.
Note
To revoke permissions, you can either edit a policy or remove it.
Editing a Policy
The easiest way to edit a policy is to use the Amazon SES console. If you want to use the Amazon
SES API instead, you can use the GetIdentityPolicies API to retrieve the policy, edit the policy
by using a text editor, and then use the PutIdentityPolicy API to overwrite the older policy. These
actions are explained in the Amazon Simple Email Service API Reference.
The following procedure shows you how to edit a policy by using the Amazon SES console.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
2.
In the left navigation pane, under Identity Management, choose either Email Addresses or
Domains.
3.
In the resource list, choose the identity that is associated with the policy that you want to edit.
4.
In the details pane, expand Identity Policies, find the policy that you want in the Identity Policy
list, and then choose Edit Policy.
5.
In the Edit Policy pane, edit the policy, and then choose Apply Policy.
6.
Removing a Policy
To revoke permissions at any time, you can simply remove the policy. You can remove a policy by
using the DeleteIdentityPolicy API, as explained in the Amazon Simple Email Service API
Reference, or you can use the Amazon SES console, as described in the following procedure.
Important
After you remove a policy, there is no way to get it back. We recommend that you back up the
policy by copying and pasting it into a text file before you remove the policy.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
2.
In the left navigation pane, under Identity Management, choose either Email Addresses or
Domains.
3.
In the resource list, choose the identity that is associated with the policy that you want to remove.
4.
In the details pane, expand Identity Policies, find the policy that you want to remove, and then
choose Remove Policy.
5.
To list and show the policies attached to an identity by using the Amazon SES console
1.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
2.
In the left navigation pane, under Identity Management, choose either Email Addresses or
Domains.
3.
In the resource list, choose the identity for which you want to see policies.
4.
In the details pane, expand Identity Policies. You will see a list of policies.
5.
Find the policy that you want to view in the Identity Policy list, and then choose Show Policy.
6.
After you are finished viewing the policy, close the Show Policy dialog box.
Sign in to the AWS Management Console and open the IAM console at https://
console.aws.amazon.com/iam/.
2.
3.
In the resource list, choose the user name. The Summary section displays the ARN. The ARN will
look something like arn:aws:iam::123456789012:user/John.
2.
Expand Account Settings. The AWS account ID is at the top of this section.
Important
As the delegate sender, bounces and complaints count toward your bounce and complaint
metrics. High bounce and complaint rates put your account at risk of being shut down, so
ensure that you set up notifications and have a process in place to monitor the notifications
and remove recipient addresses that have bounced or complained from your mailing list. For
more information, see Processing Bounces and Complaints (p. 228).
You will be charged standard Amazon SNS rates for bounce, complaint, and delivery notifications. For
more information, see the Amazon SNS pricing page.
The following sections show you how to manage cross-account identity notifications.
Setting Up a Notification Configuration (p. 214)
Editing a Notification Configuration (p. 215)
Viewing a Notification Configuration (p. 215)
Removing a Notification Configuration (p. 216)
To set up Amazon SNS bounce, complaint, and/or delivery notifications by using the
Amazon SES console
1.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
2.
3.
4.
In the Edit Notification Configuration dialog box, enter the ARN of the identity that the identity
owner has authorized you to use, and for which you want to configure notifications. The identity
cannot belong to the account that is currently logged in. If you want to configure notifications for
your own identities, see Configuring Amazon SNS Notifications for Amazon SES (p. 110).
5.
Specify the existing Amazon SNS topics that you want to use for bounces, complaints, and/or
deliveries, or create a new Amazon SNS topic.
API Version 2010-12-01
214
Important
The Amazon SNS topics that you use for Amazon SES notifications must be within the
same AWS region in which you are using Amazon SES.
You can choose to publish bounce, complaint, and delivery notifications to the same Amazon SNS
topic or to different Amazon SNS topics. If you want to use an Amazon SNS topic that you do
not own, then the owner of that topic must configure an Amazon SNS access policy that allows
your account to call the SNS:Publish action on their topic. For information about how to control
access to your Amazon SNS topic through the use of IAM policies, see Managing Access to Your
Amazon SNS Topics.
6.
Choose Save Config to save your notification configuration. Changes might take a few minutes to
take effect.
After you have configured your settings, you will start receiving bounce, complaint, and/or delivery
notifications to your Amazon SNS topic(s). These notifications will follow the structure described in
Amazon SNS Notification Contents for Amazon SES (p. 111).
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
2.
3.
Choose the ARN of the identity for which you want to view the notification configuration.
4.
Note
Setting all notifications to No SNS Topic is the equivalent of removing the identity's
notification configuration entirely. In this case, the ARN of the cross-account identity will
disappear from your list of cross-account identity ARNs in the Amazon SES console. This
does not mean that you cannot continue to send for that identity; it just means that you
are no longer set up to receive bounce, complaint, and/or delivery notifications for it. If
you want to re-enable notifications, you need to repeat the notification setup procedure
described in Setting Up a Notification Configuration (p. 214).
Note
The only cross-account identities that you will find in the cross-account identity list are the
identities for which you have configured notifications by using the procedure described in
Setting Up a Notification Configuration (p. 214).
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
2.
3.
Note
When you remove a notification configuration, the ARN of the cross-account identity will
disappear from your list of cross-account identity ARNs in the Amazon SES console. This
does not mean that you cannot continue to send for that identity; it just means that you are no
longer set up to receive bounce, complaint, and/or delivery notifications for it. If you want to reenable notifications, you need to repeat the notification setup procedure described in Setting
Up a Notification Configuration (p. 214).
The following procedure shows you how to remove a cross-account notification configuration by using
the Amazon SES console.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
2.
3.
Choose the box to the left of the cross-identity that you want to remove, and then choose
Remove.
4.
In the Remove Cross-Account Notification Config dialog box, choose Delete Notification
config.
The ARN of the cross-account identity will no longer appear in the list of cross-account identity
ARNs. This does not mean that you cannot send for the identity, just that you no longer have
configured notifications for it.
API Version 2010-12-01
216
Important
To successfully send an email on behalf of an identity owner's identity, you must connect to
the Amazon SES endpoint of the AWS region in which the identity is verified. The sending
authorization policy that grants you permission must be attached to the identity in that region.
SendRawEmail
If you want to use SendRawEmail so that you can control the format of your emails, you can specify
the cross-account identity in one of two ways:
Pass optional parameters to the SendRawEmail API These parameters are as follows:
Parameter
Description
SourceArn
Note
For the most common use case, we
recommend that you specify the SourceArn
and do not specify either the FromArn
or ReturnPathArn. If you only specify
the SourceArn, Amazon SES will simply
set the "From" address and the "Return
Path" addresses to the identity specified in
SourceArn.
FromArn
ReturnPathArn
Include X-headers in the email X-headers are custom headers that you can use in addition to
standard email headers. Amazon SES has three X-headers that you can use to specify sending
authorization parameters. If you include multiple instances of any of the X-headers, Amazon SES
will use the first instance. In all cases, Amazon SES removes all X-headers from the email before
sending it. The following table shows you the three X-headers that you can use with Amazon SES for
sending authorization.
Important
Do not include these X-headers in the DKIM signature, because they are removed by
Amazon SES before sending the email.
X-Header
Description
X-SES-SOURCE-ARN
X-SES-FROM-ARN
X-SES-RETURN-PATH-ARN
The following example shows an email that includes sending authorization X-headers:
X-SES-SOURCE-ARN: arn:aws:ses:us-west-2:123456789012:identity/example.com
X-SES-FROM-ARN: arn:aws:ses:us-west-2:123456789012:identity/example.com
X-SES-RETURN-PATH-ARN: arn:aws:ses:us-west-2:123456789012:identity/
example.com
From: [email protected]
To: [email protected]
Return-Path: [email protected]
Subject: subject
Content-Type: multipart/alternative;
boundary="----=_boundary"
------=_boundary
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
body
------=_boundary
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit
body
------=_boundary--
SendEmail
If you want to use SendEmail so that Amazon SES formats your emails for you, you can specify the
cross-account identity by passing in the optional parameters below. You cannot use the X-header
method because when you use SendEmail, Amazon SES assembles the message for you.
Parameter
Description
SourceArn
Parameter
Description
ReturnPathArn
Cost
Shared IPs are included with Amazon SES. Dedicated IPs incur an extra cost. For pricing information,
see the Amazon SES pricing page.
API Version 2010-12-01
219
Email Volume
With shared IPs, you can send as little email as you like. To be a good candidate for dedicated IPs,
we typically require you to have a daily sending quota (p. 192) of at least 150,000 emails per day.
If your existing daily sending quota is less than 150,000 emails per day, please describe your use
case in detail in your dedicated IP request and we will evaluate a sending quota increase within the
same case. If you are granted dedicated IPs, you must consistently send at least 50,000 emails
per dedicated IP per day after you warm up (p. 222) the dedicated IPs. This is to maintain the
reputational health of the IPs.
We sometimes grant exceptions to the sending quota requirement to senders who only send mail to
a small, well-defined list of recipients who decide whether to accept or reject mail based on the IP
address that sent the mail (rather than the reputation of the IP).
Sending Pattern
When you use dedicated IPs, we recommend that you gradually ramp up your sending as described
in How to Warm Up Dedicated IPs (p. 222), and then maintain a sustained and consistent sending
pattern. With shared IPs, you can scale your sending up or down at any time.
Reputation Isolation
Dedicated IPs enable you to isolate the reputation of your separate mail streams, and to separate the
reputation of your email sending from the sending of other Amazon SES customers. However, this also
means that you are primarily responsible for maintaining the reputation of your IPs because your IP
reputation is largely driven by the email you send.
Regardless of the type of IPs you use, you must ensure that your email sending follows standard best
practices. For best practices, see Obtaining and Maintaining Your Recipient List (p. 228), Processing
Bounces and Complaints (p. 228), Improving Deliverability with Amazon SES (p. 227), and the
Amazon Simple Email Service Email Sending Best Practices whitepaper.
Sign in to the AWS Management Console and open an SES Sending Limits Increase case in
Support Center. You can also reach this link using the Dedicated IPs page in the Amazon SES
console.
2.
In the case submission form, choose the region, choose Desired Maximum Send Rate, and then
enter the number of emails per second you expect to use with dedicated IPs.
3.
For the Use Case Description, tell us that you are requesting dedicated IPs, and provide as much
detail as possible about your use case, including what you expect your daily sending volume will
be with dedicated IPs. If we determine that you are a good candidate for dedicated IPs, we will let
you know the number of dedicated IPs that best fits your use case.
4.
After we evaluate your request, you will receive a reply within the case. This reply could be the
outcome of your request, or a request for more information. If your current daily sending quota is
less than the minimum requirement of 150,000 emails per day, we will evaluate a quota increase
within the same case.
5.
If the case reply indicates that you have been granted dedicated IPs, do the following steps:
a.
Open another AWS account. This is the account you will use with your dedicated IPs.
b.
In the other account, configure Amazon SES (notifications, verified identities, and so on) for
the sending you will do with dedicated IPs. You do not need to submit a separate sending
limit increase case for the new account because we will make the sending limits on your new
account the same as the sending limits of your old account.
c.
Find the AWS account ID of the new account. To find the AWS account ID, ensure that you
are signed into the new account, and then go to https://console.aws.amazon.com/billing/
home?#/account.
d.
Sign out of the new AWS account, and sign back into the old account.
e.
Go to Support Center, and provide the AWS account ID of the new account in a reply to your
dedicated IP limit increase case.
f.
You will receive a case reply confirming that your dedicated IPs are now associated with your
new account.
g.
Warm up the dedicated IPs as described in How to Warm Up Dedicated IPs (p. 222).
Sign in to the AWS Management Console with the account you use for dedicated IPs, and open
an SES Sending Limits Increase case in Support Center. You can also reach this link using the
Dedicated IPs page in the Amazon SES console.
2.
In the case submission form, choose the region, choose Desired Maximum Send Rate, and then
enter the number of emails per second you expect to use across all of your dedicated IPs.
3.
For the Use Case Description, tell us that you are requesting additional dedicated IPs, explain
why you need them, and include what you expect your daily sending volume will be across all of
your dedicated IPs. If we determine that you need additional dedicated IPs, we will let you know
the number of additional dedicated IPs that best fits your use case.
4.
After we evaluate your request, you will receive a reply within the case. This reply could be the
outcome of your request, or a request for more information. If your request is granted, the reply will
confirm that your dedicated IPs are now associated with your new account.
5.
If your request is granted, you do not need to warm up the new dedicated IPs because Amazon
SES will distribute your sending among all of your dedicated IPs.
2.
3.
4.
5.
Sign in to the AWS Management Console with the account you use for dedicated IPs, and open
an SES Sending Limits Increase case in Support Center. You can also reach this link using the
Dedicated IPs page in the Amazon SES console.
In the case submission form, choose the region, choose Desired Maximum Send Rate and then
enter any number. (You will specify how many dedicated IPs you want to relinquish within the use
case description.)
For the Use Case Description, tell us that you want to relinquish dedicated IPs, and how many
dedicated IPs you want to relinquish.
After we evaluate your request, you will receive a reply within the case asking you to confirm that
you want to release the number of dedicated IPs that you specified.
You will receive a case reply confirming that your dedicated IPs have been released.
Number of emails
Percentage of your
sending
22,222
2.22%
44,444
4.44%
66,667
6.67%
88,889
8.89%
111,111
11.11%
133,333
13.33%
Day
Number of emails
Percentage of your
sending
155,556
15.56%
177,778
17.78%
200,000
20.00%
10
222,222
22.22%
11
244,444
24.44%
12
266,667
26.67%
13
288,889
28.89%
14
311,111
31.11%
15
333,333
33.33%
16
355,556
35.56%
17
377,778
37.78%
18
400,000
40.00%
19
422,222
42.22%
20
444,444
44.44%
21
466,667
46.67%
22
488,889
48.89%
23
511,111
51.11%
24
533,333
53.33%
25
555,556
55.56%
26
577,778
57.78%
27
600,000
60.00%
28
622,222
62.22%
29
644,444
64.44%
30
666,667
66.67%
31
688,889
68.89%
32
711,111
71.11%
33
733,333
73.33%
34
755,556
75.56%
35
777,778
77.78%
36
800,000
80.00%
37
822,222
82.22%
Day
Number of emails
Percentage of your
sending
38
844,444
84.44%
39
866,667
86.67%
40
888,889
88.89%
41
911,111
91.11%
42
933,333
93.33%
43
955,56
95.556%
44
977,78
97.778%
45
1,000,000
100.00%
After you successfully warm up your dedicated IPs, you must send at least 50,000 emails per
dedicated IP per day so that the IPs maintain a positive reputation with ISPs.
Note
You can only access the mailbox simulator by using Amazon SES. You cannot access it from
an external mail server.
Simulated scenario
Simulated scenario
Important
If you send an email to a mailbox simulator address other than the test addresses listed
above, the unlisted address will be placed on the suppression list.
The mailbox simulator provides typical bounce, complaint, and OOTO responses. In the bounce
scenario, multiple bounces from the same sending request are gathered into a single response. In
practice, the response varies by ISP. To reduce your bounce and complaint rates, see the Amazon
Simple Email Service Email Sending Best Practices whitepaper.
When you send emails to the mailbox simulator, you will be limited by your maximum send rate. You
will also be billed for your emails. However, emails to the mailbox simulator will not affect your email
deliverability metrics for bounces and complaints or count against your sending quota.
The mailbox simulator supports labeling, which enables you to send emails to the same mailbox
simulator address in multiple ways, or to test your support for Variable Envelope Return Path (VERP).
For example, you can send an email to [email protected] and bounce
[email protected] to test how your setup matches a bounce message with the
undeliverable address that caused the bounce. For more information about VERP, see https://
en.wikipedia.org/wiki/Variable_envelope_return_path.
You can send emails to the mailbox simulator even if you are in the sandbox.
For technical discussions about various Amazon SES topics, visit the Amazon SES Blog. To browse
and post questions, go to the Amazon SES Forum.
HTTP
If you are using the Amazon SES API (either directly or through an AWS SDK), then all
communications are encrypted by TLS through the Amazon SES HTTPS endpoint. The Amazon SES
HTTPS endpoint supports TLS 1.2, TLS 1.1, and TLS 1.0.
SMTP Interface
If you are accessing Amazon SES through the SMTP interface, you are required to encrypt your
connection using Transport Layer Security (TLS). Note that TLS is often referred to by the name of its
predecessor protocol, Secure Sockets Layer (SSL).
Amazon SES supports two mechanisms for establishing a TLS-encrypted connection: STARTTLS and
TLS Wrapper.
STARTTLSSTARTTLS is a means of upgrading an unencrypted connection to an encrypted
connection. There are versions of STARTTLS for a variety of protocols; the SMTP version is defined
in RFC 3207. For STARTTLS connections, Amazon SES supports TLS 1.2, TLS 1.1, TLS 1.0 and
SSLv2Hello.
TLS WrapperTLS Wrapper (also known as SMTPS or the Handshake Protocol) is a means of
initiating an encrypted connection without first establishing an unencrypted connection. With TLS
Wrapper, the Amazon SES SMTP endpoint does not perform TLS negotiation: it is the client's
responsibility to connect to the endpoint using TLS, and to continue using TLS for the entire
conversation. TLS Wrapper is an older protocol, but many clients still support it. For TLS Wrapper
connections, Amazon SES supports TLS 1.2, TLS 1.1 and TLS 1.0.
For information about connecting to the Amazon SES SMTP interface using these methods, see
Connecting to the Amazon SES SMTP Endpoint (p. 61).
If your software does not support STARTTLS or TLS Wrapper, you can set up a secure tunnel to allow
your software to communicate with the Amazon SES SMTP endpoint. For information about how to set
up a secure tunnel, see Setting Up a Secure Tunnel to Connect to Amazon SES (p. 68).
API Version 2010-12-01
226
Watch for upward trends in rejected emails. Amazon SES will generate a MessageRejected error
for any message that it does not accept; if you see a large number of rejections, make sure that none
of your applications are trying to send the same rejected message repeatedly.
For a more in-depth discussion of these and other best practices, see the Amazon Simple Email
Service Email Sending Best Practices whitepaper.
Treat suppression list bounces like any other hard bounce. Although it is possible to remove
addresses from the suppression list by using the Amazon SES console, only do that if you are 100%
sure that the email address is valid. In most cases, the email address is not valid, and you should
remove it from your list.
If you need to test your bounce and complaint handling process, use the Amazon SES mailbox
simulator. Emails that you send to the mailbox simulator do not affect your bounce and complaint
rates. For more information, see Testing Amazon SES Email Sending (p. 224).
For technical discussions about various Amazon SES topics, visit the Amazon SES Blog. To browse
and post questions, go to the Amazon SES Forum.
For tips on how to increase your email sending speed when you make multiple calls to Amazon SES
using either the API or the SMTP interface, see Increasing Throughput with Amazon SES (p. 237).
For solutions to common problems that you might encounter when you use Amazon SES through its
Simple Mail Transfer Protocol (SMTP) interface, see Amazon SES SMTP Issues (p. 238).
For a list of SMTP response codes that a client application can receive from Amazon SES, see
SMTP Response Codes Returned by Amazon SES (p. 240).
For a list of error codes that are returned by the Amazon SES Query (HTTPS) API, see API Error
Codes Returned by Amazon SES (p. 242).
For a description of common enforcement issues and how to handle them, see Amazon SES
Enforcement FAQs (p. 245).
For a discussion about how IP blacklists affect your sending with Amazon SES, see Amazon SES IP
Blacklist FAQ (p. 257).
If you are calling the Amazon SES API directly, see the Amazon Simple Email Service API Reference
for the HTTP errors that you might receive.
For technical discussions about various Amazon SES topics, visit the Amazon SES Blog. To browse
and post questions, go to the Amazon SES Forum.
Note
When your call to Amazon SES to send an email fails, you are not billed for that email.
The following are the types of Amazon SES-specific problems that can cause Amazon SES to return
an error when you try to send an email. These errors are in addition to general AWS errors like
MalformedQueryString as specified in the Common Errors topic of the Amazon Simple Email
Service API Reference.
Email address is not verified. The following identities failed the check in region <region>:
<identity1>, <identity2>, <identity3>You are trying to send email from an email address or
domain that you have not verified with Amazon SES (p. 39). This error could apply to the "From",
"Source", "Sender", or "Return-Path" address. If your account is still in the sandbox, you also must
API Version 2010-12-01
231
verify every recipient email address except for the recipients provided by the Amazon SES mailbox
simulator (p. 224). If Amazon SES is not able to show all of the failed identities, the error message
ends with an ellipsis.
Note
Amazon SES has endpoints in multiple AWS regions (p. 332), and email address
verification status is separate for each AWS region. You must complete the verification
process for each sender in the AWS region(s) you want to use.
Customer is suspendedYour AWS account has been blocked from sending email using
Amazon SES. You can still access the Amazon SES console and perform any activity (e.g., view
your metrics) except for email sending; if you attempt to send an email, you will receive this error
message.
If this happens, you should have received an email from Amazon SES to the email address
associated with your AWS account informing you of the problem. To appeal your suspension and
reinstate email sending privileges, follow the instructions in the email. You will need to explain in
detail why you believe that the suspension itself was an error, or the changes you have made to
ensure that the same problem does not occur again.
ThrottlingAmazon SES is limiting the rate at which you can send messages. Your application may
be trying to send too much email, or to send email at too fast a rate. In these cases, the error may be
similar to the following:
Daily message quota exceededYou have sent the maximum number of messages that you are
permitted in a 24-hour period. If you have exceeded your daily quota, you will have to wait until the
next 24-hour period before you can send more email.
Maximum sending rate exceededYou are attempting to send more emails per second than is
permitted by your maximum send rate. If you have exceeded your sending rate, you can continue
to send email, but will need to reduce your send rate. For more information, see How to handle a
"Throttling - Maximum sending rate exceeded" error on the Amazon SES blog.
You should regularly monitor your sending activity to see how close you are to your sending limits.
For more information, see Monitoring Your Amazon SES Sending Limits (p. 193). For general
information about sending limits, see Managing Your Amazon SES Sending Limits (p. 192). For
information about how to increase your sending limits, see Increasing Your Amazon SES Sending
Limits (p. 194).
Important
If the error text that explains the throttling error is not related to you exceeding your daily
quota or maximum send rate, then there might be a system-wide problem that is causing
reduced sending capabilities. For information about the service status, go to the AWS
Service Health Dashboard.
There are no recipients specifiedNo recipients were provided.
There are non-ASCII characters in the email addressThe email address string must be 7-bit
ASCII. If you want to send to or from email addresses that contain Unicode characters in the domain
part of an address, you must encode the domain using Punycode. Punycode is not permitted in the
local part of the email address (i.e., the part before the @) nor in the "friendly from" name. If you
want to use Unicode characters in the "friendly from" name, you must encode the "friendly from"
name using MIME encoded-word syntax, as described in Sending Raw Email Using the Amazon
SES API (p. 88). For more information about Punycode, see RFC 3492.
Mail FROM domain is not verifiedAmazon SES could not read the MX record required to use
the specified MAIL FROM domain. For information about editing the custom MAIL FROM domain
settings for an identity, see Editing a MAIL FROM Domain with Amazon SES (p. 51).
Configuration set does not existThe configuration set that you specified does not exist. A
configuration set is an optional parameter that you use to publish email sending events. For more
information, see Monitoring Using Amazon SES Event Publishing (p. 127).
To verify that your domain verification TXT record is published to your DNS server
1.
Find the name servers for your domain by taking the following steps.
a.
Go to the command line. To get to the command line on Windows 7, choose Start and then
type cmd. On Linux-based operating systems, open a terminal window.
b.
At the command prompt, type the following, where <domain> is your domain. This will list all
of the name servers that serve your domain.
nslookup -type=NS <domain>
The command's output will list the name servers that serve your domain. You will query one of
these servers in the next step.
2.
Verify that the TXT record is correctly published by taking the following steps.
a.
At the command prompt, type the following, where <domain> is your domain, and <name
server> is one of the name servers you found in step 1.
nslookup -type=TXT
In our ses-example.com example, if a name server that we found in step 1 was called
ns1.name-server.net, we would type the following:
API Version 2010-12-01
233
nslookup -type=TXT
b.
_amazonses.ses-example.com ns1.name-server.net
In the output of the command, verify that the string that follows text = matches the TXT
value you see when you choose the domain in the Identities list of the Amazon SES console.
In our example, we are looking for a TXT record under _amazonses.ses-example.com with a
value of fmxqxT/icOYx4aA/bEUrDPMeax9/s3frblS+niixmqk=. If the record is correctly
published, we would expect the command to have the following output:
_amazonses.ses-example.com text = "fmxqxT/icOYx4aA/bEUrDPMeax9/s3frblS
+niixmqk="
You receive an email from Amazon SES that says your domain verification has been (or will
be) revokedAmazon SES can no longer find the required TXT record on your DNS server. The
notification email will inform you of the length of time in which you must re-publish the TXT record
before your domain verification status is revoked.
Note
You can review the required TXT record information in the Amazon SES console by using
the following instructions. In the navigation pane, under Identities, choose Domains. In
the list of domains, choose (not just expand) the domain to display the domain verification
settings, which include the TXT record name and value.
If your domain verification status is revoked, you must restart the verification procedure in Verifying
Domains in Amazon SES (p. 41) from the beginning, just as if the revoked domain were an entirely
new domain. After you publish the TXT record to your DNS server, verify that the TXT record is
correctly published by using How to Check Domain Verification Settings (p. 233).
Your emails are being DKIM-signed, but the DKIM signature is not validatingSee DKIM
Troubleshooting Series: Why is My Signature Not Validating? on the Amazon SES blog.
You receive an email from Amazon SES that says your DKIM setup has been (or will be)
revokedThis means that Amazon SES can no longer find the required CNAME records on your
DNS server. The notification email will inform you of the length of time in which you must re-publish
the CNAME records before your DKIM setup status is revoked and DKIM signing is disabled. If
your DKIM setup is revoked, you must restart the DKIM set-up procedure in Easy DKIM in Amazon
SES (p. 94) from the beginning.
You do not have DKIM-signing enabled, yet your message headers contain a DKIM
signatureThe DKIM signature you are seeing contains d=amazonses.com and is automatically
added by Amazon SES.
Your emails contain two DKIM signaturesThe extra DKIM signature, which contains
d=amazonses.com, is automatically added by Amazon SES. You can ignore it.
Important
As with any email address that hard bounces, you should remove addresses that cause a
suppression list bounce from your mailing list unless you are absolutely sure the address
is valid, because suppression list bounces count towards your bounce rate and a high
bounce rate puts your account at risk of being shut down. If you remove an address from the
suppression list when it is indeed undeliverable, then the next time you or another Amazon
SES customer sends an email to that address, it will hard bounce and the address will go back
on the suppression list.
If you are sure that an address on the suppression list is valid, you can remove it from the list by using
the following procedure. Although each AWS region has a separate suppression list, if you remove an
address from the suppression list of one region, the address is removed from the suppression list of all
regions.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
In the Navigation pane, choose Suppression List Removal.
4.
In the Email Address field, type the email address that you want to remove from the suppression
list.
In the Type characters field, type the characters that you see in the image above it.
5.
Choose Submit.
After you submit the form, you can fill out the form for another email address. Suppression list removal
requests are processed immediately.
application is generating emails to the mail server in a single-threaded fashion, the mail server will
use multiple threads when sending to Amazon SES. For more information, see Integrating Amazon
SES with Your Existing Email Server (p. 67).
Consider hosting your application closer to the Amazon SES API endpointYou may wish to
consider hosting your application in a data center close to the Amazon SES API endpoint, or on an
Amazon EC2 instance in the same AWS Region as the Amazon SES API endpoint. This may help to
decrease network latency between your application and Amazon SES, and improve throughput. For
a list of Amazon SES endpoints, see Regions and Amazon SES (p. 332).
Consider using multiple machinesDepending on the system configuration on your host
machine, there may be a limit on the number of simultaneous HTTP connections to a single IP
address, which may limit the benefits of parallelism once you exceed a certain number of concurrent
connections on a single machine. If this is a bottleneck, you may wish to consider making concurrent
Amazon SES requests using multiple machines.
Consider using the Amazon SES query API instead of the SMTP endpointUsing the Amazon
SES query API enables you to submit the email send request using a single network call, whereas
interfacing with the SMTP endpoint involves an SMTP conversation which consists of multiple
network requests (for example, EHLO, MAIL FROM, RCPT TO, DATA, QUIT). For more information
about the Amazon SES query API, see Using the Amazon SES API to Send Email (p. 87).
Use the Amazon SES mailbox simulator to test your maximum throughputTo test any
changes you may implement, you can use the mailbox simulator. The mailbox simulator can help
you to determine your systems maximum throughput without using up your daily sending quota. For
information about the mailbox simulator, see Testing Amazon SES Email Sending (p. 224).
If you are accessing Amazon SES through its SMTP interface, see Amazon SES SMTP
Issues (p. 238) for specific SMTP-related issues that may affect throughput.
message delivery in case of a network error. SMTP is a verbose protocol and submitting an email
using this protocol requires several network round trips. Because of the nature of this protocol, the
potential of transient network errors increases. A message is accepted by Amazon SES for delivery
only when Amazon SES responds with an Amazon SES message ID.
You lose connection with the SMTP endpoint
If you receive a time-out error message, the maximum transmission unit (MTU) size on the
network interface of the computer you're using to connect to the Amazon SES SMTP interface
might be too large. To mitigate this, you can try setting the MTU size on that computer to 1500. For
instructions on how to set the MTU size on Microsoft Windows, Linux, and Mac OS X operating
systems, see Queries Appear to Hang in the Client and Do Not Reach the Cluster in the Amazon
Redshift Cluster Management Guide. Users connecting to Amazon SES from an Amazon EC2
instance can alternatively try the workaround described in Security Group Rules for Path MTU
Discovery in the Amazon EC2 User Guide for Linux Instances.
Do not attempt to maintain long-lived connections with the Amazon SES SMTP endpoint. The
Amazon SES SMTP endpoint runs on a fleet of Amazon EC2 instances behind an Elastic Load
Balancer (ELB). In order to ensure that the system is up-to-date and fault tolerant, active Amazon
EC2 instances are periodically terminated and replaced with new instances. Because your
application connects to an Amazon EC2 instance through the ELB, the connection becomes
invalid when the Amazon EC2 instance is terminated. You should establish a new SMTP
connection after you have delivered a fixed number of messages via a single SMTP connection,
or if the SMTP connection has been active for some amount of time. You will need to experiment
to find appropriate thresholds depending on where your application is hosted and how it submits
email to Amazon SES.
You want to know the IP addresses of the Amazon SES SMTP mail servers so that you can
whitelist the IP addresses with your networkWe are unable to provide a specific set of IP
addresses for the Amazon SES SMTP endpoints because they reside behind load balancers and the
IP addresses can change frequently. We recommend that you only whitelist based on DNS and not
static IP addresses.
You are integrating Amazon SES with a Sendmail or Postfix mail server using the instructions
in Integrating Amazon SES with Your Existing Email Server (p. 67), and your mail server
cannot authenticate with the Amazon SES SMTP endpoint because the hostname does not
match. In this case, try the following steps.
SendmailIn Step 1 of Integrating Amazon SES with Sendmail (p. 72), put the following
additional line in /etc/mail/authinfo, depending on the AWS region of the Amazon SES endpoint
you are using. Note that you must replace USERNAME and PASSWORD with your SMTP user
name and password.
Region name
US East (N.
Virginia)
US West
(Oregon)
EU (Ireland)
In Step 4 of Integrating Amazon SES with Sendmail (p. 72), add the following to /etc/mail/access:
Region name
US East (N.
Virginia)
Connect:ses-smtp-prod-335357831.useast-1.elb.amazonaws.com RELAY
US West
(Oregon)
Connect:ses-smtp-us-west-2-prod-14896026.uswest-2.elb.amazonaws.com RELAY
EU (Ireland)
Connect:ses-smtp-eu-west-1-prod-345515633.euwest-1.elb.amazonaws.com RELAY
PostfixIn Step 3 of Integrating Amazon SES with Postfix (p. 69), put the following additional line
in /etc/postfix/sasl_passwd, depending on the AWS region of the Amazon SES endpoint you are
using. Note that you must replace USERNAME and PASSWORD with your SMTP user name and
password.
Region name
US East (N.
Virginia)
ses-smtp-prod-335357831.us-east-1.elb.amazonaws.com:25
USERNAME:PASSWORD
US West
(Oregon)
ses-smtp-us-west-2-prod-14896026.uswest-2.elb.amazonaws.com:25 USERNAME:PASSWORD
EU (Ireland)
ses-smtp-eu-west-1-prod-345515633.euwest-1.elb.amazonaws.com:25 USERNAME:PASSWORD
Note
AWS SDKs implement retry logic automatically, although they use the HTTPS interface
instead of SMTP.
SMTP client errors (5xx) indicate that you need to revise the request to correct the problem before
trying again. For example, if your AWS authentication credentials are invalid, you must update your
setup to use the proper credentials before trying to send the email again.
Description
Response code
More information
Authentication successful
N/A
Successful delivery
Description
Response code
More information
SES permits you to send in a 24hour period. For more information,
see Managing Your Amazon SES
Sending Limits (p. 192).
Incorrect credentials
Authentication Credentials
Invalid
Description
Response code
More information
Note
Amazon SES has
endpoints in multiple
AWS regions (p. 332),
and email address
verification status is
separate for each
AWS region. You must
complete the verification
process for each sender
in the AWS region(s) you
want to use.
Note
AWS SDKs implement retry logic automatically.
HTTPS client errors (4xx) indicate that you need to revise the request to correct the problem before
trying again. For example, if your AWS authentication credentials are invalid, you must update your
setup to use the proper credentials before trying to send the email again.
Error
Description
ConfigurationSetDoesNotExist
The specified
configuration set
does not exist. A
configuration set is
an optional parameter
that you use to publish
email sending events.
For more information,
see Monitoring Using
Amazon SES Event
Publishing (p. 127).
400
SendEmail,
SendRawEmail
IncompleteSignature
400
All
InternalFailure
All
InvalidAction
400
All
InvalidClientTokenId
403
All
InvalidParameterCombination
Parameters that must
not be used together
were used together.
400
All
InvalidParameterValue
400
All
InvalidQueryParameter
400
All
400
SendEmail,
SendRawEmail
MailFromDomainNotVerified
The message could
not be sent because
Amazon SES could
not read the MX record
required to use the
Error
Description
404
All
MessageRejected
400
SendEmail,
SendRawEmail
MissingAction
400
All
MissingAuthenticationToken
The request must
contain either a valid
(registered) AWS
access key ID or X.509
certificate.
403
All
MissingParameter
A required parameter
for the specified action
is not supplied.
400
All
OptInRequired
All
RequestExpired
400
All
ServiceUnavailable
503
All
Error
Description
Throttling
400
All
Q3. Will the Amazon SES probation affect my use of other AWS services?
No.
Be sure to provide any information we specifically request. We need this information to evaluate your
case.
Note
Failure to provide this information will delay the appeal process because we will request the
remaining information before we can make a decision. In addition, be sure to provide any
additional information we specifically request during the appeal correspondence.
than just the specific incident that caused a specific probation. For instance, if a particular campaign
triggers a probation, you must do more than simply stop that campaign. You need to determine
which properties of the campaign were problematic and ensure that you have processes in place so
that your future campaigns won't have the same issue.
Q11. What if I make my fixes shortly before the probation is due to expire?
Contact us through the appeal process to let us know that you fixed the problem.
Q3. Will the Amazon SES suspension affect my use of other AWS services?
No.
the specific information we need to determine whether we can remove the probation or suspension.
For a list of information to provide, see Q6. How do I submit an appeal? (p. 248).
Note
Failure to provide this information will delay the appeal process because we will request the
remaining information before we can make a decision. In addition, be sure to provide any
additional information we specifically request during the appeal correspondence.
Q4. Do you disclose the Amazon SES bounce rate limits that trigger probation
and suspension?
No, but you can find general bounce rate guidelines and tips on how to avoid bounces in the Amazon
Simple Email Service Email Sending Best Practices whitepaper.
Q6. Can I calculate my own bounce rate by using the information from the
Amazon SES console or the GetSendStatistics API?
No. The bounce rate is calculated using representative volume (see Q5. Over what period of time is
my bounce rate calculated? (p. 249)). Depending on your sending rate, your bounce rate can stretch
farther back in time than the Amazon SES console or GetSendStatistics can retrieve. In addition,
only emails to non-verified domains are considered when calculating your bounce rate. However, if you
regularly monitor your bounce rates using those methods, you should still have a good indicator that
you can use to catch problems before they get to levels that trigger a probation or suspension.
receive emails, or that the sender is sending content that is different from the type that recipients
signed up for.
Q2. Are these complaints included in the complaint rate statistic shown in the Amazon SES
console and returned by the GetSendStatistics API?
Yes. Note, however, that the complaint rate statistic does not include complaints from ISPs that do
not provide feedback to Amazon SES. Nevertheless, the complaint rate from domains that provide
feedback is likely to be representative of the rest of your sending as well.
Q4. What should I do if I receive a complaint notification through email or through Amazon
SNS?
First, you need to remove addresses that generated complaints from your mailing list and stop sending
mail to them immediately. Do not even send an email that says you have received the request to
unsubscribe. You will probably want to set up automation for this process, either by programmatically
processing the mailbox where you receive complaints, or by setting up complaint notifications through
Amazon SNS. For more information, see Monitoring Using Amazon SES Notifications (p. 106).
Then, take a close look at your sending to determine why your recipients do not appreciate the mail
you are sending, and address that underlying problem. For every person who complains, there are
potentially dozens who didn't appreciate your mail who did not (or were not able to) complain. If all you
do is remove the recipients who actually complain, you are not addressing the underlying problem with
your sending.
Q5. Do you disclose the Amazon SES complaint rate limits that trigger probation and
suspension?
No, but you can find general complaint rate guidelines and tips on how to avoid complaints in the
Amazon Simple Email Service Email Sending Best Practices whitepaper.
Q7. Can I calculate my own complaint rate by using metrics from the Amazon SES console or
the GetSendStatistics API?
No. There are two primary reasons for this:
The complaint rate is calculated using representative volume (see Q6). Depending on your
sending rate, your complaint rate can stretch farther back in time than the Amazon SES console or
GetSendStatistics can retrieve. However, if you regularly monitor your complaint rates using
those methods, you should still have a good indicator that you can use to catch problems before they
get to levels that trigger a probation or suspension.
When calculating complaint rate, not every email counts. Complaint rate is calculated as the
percentage of complaints on mail sent to domains that send complaint feedback to Amazon SES.
Q9. If I haven't been monitoring my complaints, can you give me a list of addresses that have
complained?
Unfortunately, we can't give you a comprehensive list. However, you can monitor future complaints by
email or through Amazon SNS.
API Version 2010-12-01
252
Q2. Are these complaints included in the complaint rate statistic shown in the Amazon SES
console and returned by the GetSendStatistics API?
No. The complaint rate statistic you retrieve using the Amazon SES console or the
GetSendStatistics API only includes complaints that Amazon SES receives through ISP feedback
loops. For more information about those types of complaints, see the Amazon SES Complaints
Through ISP Feedback Loops FAQ (p. 251).
Q3. Why haven't I heard about these complaints through email feedback notifications or
through Amazon SNS?
Email feedback forwarding and Amazon SNS notifications only include complaints that Amazon SES
receives through ISP feedback loops. You will not receive notifications for complaints that recipients
filed directly with Amazon SES.
Q6. I have received a probation notice for direct recipient complaints. What should I do?
As soon as possible, fix your system so that your mailing list only includes recipients who have
specifically signed up to receive your mail, and ensure you are sending content that your recipients
actually want. Then, please email us with the details of your changes so that we can start the process
of re-evaluating your case. If three weeks pass and we don't hear from you at all, we will have to
disable your sending if we are still getting complaints about your mail.
Q2. Are these complaints included in the complaint rate statistic shown in the Amazon SES
console and returned by the GetSendStatistics API?
No. The complaint rate statistic you retrieve using the Amazon SES console or the
GetSendStatistics API only includes complaints that Amazon SES receives through ISP feedback
loops.
Q3. Why haven't I heard about these complaints through email feedback notifications or
through Amazon SNS?
Email feedback forwarding and Amazon SNS notifications only include complaints that Amazon SES
receives through ISP feedback loops.
Q6. I have received a probation or shutdown notice for this type of complaint. What should I
do?
Fix your system so that your mailing list only includes recipients who have specifically signed up to
receive your mail, and ensure that the email content itself is something your recipients actually want.
Then, please email us with the details of your changes so that we can start the process of re-evaluating
your case. If you are on probation and three weeks pass and we don't hear from you at all, we will have
to disable your sending if we are still getting complaints about your mail. If you appealing a shutdown,
then the information you send us needs to convince us that if you start sending again, the problem will
no longer occur.
Q6. How many spamtrap hits can I have before I am put on probation or
suspended?
Spamtrap hits are a very negative sign, so it takes only a small number of them to indicate that you are
engaging in questionable sending practices.
Note
This topic is about blacklists that mailbox providers use to block incoming mail from email
service providers such as Amazon SES. If you are looking for information about how Amazon
SES blocks outgoing mail to recipient addresses that have previously bounced, see Removing
an Email Address from the Amazon SES Suppression List (p. 236).
aware of any major mailbox provider using SORBS or SpamCannibal to reject messages. If you are
particularly concerned about SORBS, we recommend doing an internet search of "SORBS reliability" to
get an idea of why ISPs should never use this blacklist as the sole criteria for rejecting mail.
Q5. Emails I send are being put in the junk folder. Could this
be because an Amazon SES IP address is on a blacklist?
It is unlikely that your sending is impacted by blacklisting unless your bounce notifications contain a
message indicating that blacklisting is the reason for the rejection of the message.
For technical discussions about various Amazon SES topics, visit the Amazon SES Blog. To browse
and post questions, go to the Amazon SES Forum.
Recipient-Based Control
The primary way to control your incoming mail is to specify how mail is handled based on its recipient.
For example, if you own example.com, you can specify that mail for [email protected] should
API Version 2010-12-01
259
bounce, and that all other mail for example.com and its subdomains should be delivered. The list of
recipients you provide is called the condition.
You set up receipt rules to specify how to handle the mail when a condition is satisfied. A receipt rule
consists of a condition and an ordered list of actions. If the recipient to whom the incoming mail is
addressed matches a recipient specified in the condition, then Amazon SES performs the actions
specified in the rule. The following actions are available:
S3 actionDelivers the mail to an Amazon S3 bucket and, optionally, notifies you through Amazon
SNS.
SNS actionPublishes the mail to an Amazon SNS topic.
Note
The SNS action includes a complete copy of the email content in the Amazon SNS
notifications. The other Amazon SNS notifications mentioned here simply notify you of email
delivery; they contain information about the email, not the email content itself.
Lambda actionCalls your code through a Lambda function and, optionally, notifies you through
Amazon SNS.
Bounce actionRejects the email by returning a bounce response to the sender and, optionally,
notifies you through Amazon SNS.
Stop actionTerminates the evaluation of the receipt rule set and, optionally, notifies you through
Amazon SNS.
Add header actionAdds a header to the received email. You typically use this action only in
combination with other actions.
WorkMail actionHandles the mail with Amazon WorkMail. You will typically not use this action
directly because Amazon WorkMail takes care of the setup.
Receipt rules are grouped together into receipt rule sets. You can define multiple receipt rule sets for
your AWS account, but only one receipt rule set is active at any time. The following figure shows how
receipt rules, receipt rule sets, and actions relate to each other.
IP Address-Based Control
You can control your mail flow on a broader level by setting up IP address filters. IP address filters
are optional and enable you to specify whether to accept or reject mail originating from an IP address
or range of IP addresses. Your IP address filters can include block lists (IP addresses from which
you want to block incoming mail) and allow lists (IP addresses from which you want to always accept
mail). IP address filters are useful for blocking spam. Amazon SES maintains its own block list of
IP addresses known to send spam, but you can choose to receive mail from those IP addresses by
adding them to your allow list.
API Version 2010-12-01
260
Note
If you want to allow mail that originates from an Amazon EC2 IP address, you must add it to
your allow list. All mail originating from Amazon EC2 is blocked by default.
Email-Receiving Process
When Amazon SES receives an email for your domain, the following events occur:
1. Amazon SES first looks at the IP address of the sender. Amazon SES allows the mail to pass this
stage unless:
The IP address is in your block list.
The IP address is in the Amazon SES block list and not on your allow list.
2. Amazon SES examines your active receipt rule set to determine whether any of your receipt rules
contain a condition that matches any of the incoming email's recipients.
3. If there aren't any matches, Amazon SES rejects the mail. Otherwise, Amazon SES accepts the
mail.
4. If Amazon SES accepts the mail, it evaluates your active receipt rule set. All of the receipt rules that
match at least one of the recipient conditions are applied in the order that they are defined, unless
an action or a receipt rule explicitly terminates evaluation of the receipt rule set.
Now that you have an overview of the process, you can get started by going to Setting Up Email
Receiving (p. 273).
Sign Up
If you already have an AWS account, skip to the next section: Register a Domain with Amazon Route
53 (p. 262). Otherwise, follow these steps.
API Version 2010-12-01
261
2.
Sign in to the AWS Management Console using the AWS account that you used to register
your domain with Amazon Route 53, and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
2.
In the left navigation pane, under Identity Management, choose Domains. Then, in the content
pane, choose Verify a New Domain.
3.
Enter the name of the domain that is registered in Amazon Route 53, leave Generate DKIM
Settings unselected (it is for email sending), and then choose Verify This Domain.
API Version 2010-12-01
262
4.
On the Verify a New Domain page, which displays the records you must add to your DNS server,
choose Use Route 53.
Note
If you do not see Use Route 53, then your domain is not registered with Amazon Route
53, which is a prerequisite for this tutorial.
5.
On the Use Route 53 page, choose Domain Verification Record, choose Email Receiving
Record, and choose the hosted zone you want to use.
Important
If you have already set up mail exchanger (MX) records for your domain, the next step will
replace your old MX records with new records. MX records specify the mail server that
you want to accept emails on behalf of your domain.
6.
Choose Create Record Sets. You will go back to the Domain Identities list.
7.
Wait a few minutes, and then refresh the Domain Identities list by using the refresh button near
the top right of the content pane. Confirm that the status of the domain is verified.
In the left navigation pane, under Email Receiving, choose Rule Sets. Then, in the content pane,
choose Create a Receipt Rule.
2.
On the Recipients page, choose Next Step. Because you aren't adding any recipients, this
receipt rule will handle mail for all recipients in all of your verified domains.
3.
4.
5.
For Bucket Name, enter a new bucket name. Bucket names must comply with the following
requirements.
Can contain lowercase letters, numbers, periods (.), and hyphens (-).
Must be unique across all of AWS.
Must start with a number or letter.
Must be between 3 and 63 characters long.
Must not contain underscores (_), end with a hyphen, or be formatted as an IP address (e.g.,
192.168.5.4).
Cannot contain two, adjacent periods or dashes next to periods.
Next, choose Create Bucket.
Note
Because you are creating the Amazon S3 bucket using the Amazon SES console,
Amazon SES automatically sets up the policy required to give Amazon SES permission to
write to the bucket. However, if you choose an Amazon S3 bucket that already exists, you
API Version 2010-12-01
267
must explicitly give Amazon SES permission to write to the bucket by attaching a policy to
the bucket using the Amazon S3 console or API.
6.
Leave all other options at their default settings for the simplicity of this tutorial, and choose Next
Step.
7.
On the Rule Details page, for the rule name, type my-rule, leave all other options at their default
settings, and then choose Next Step.
8.
2. In the Amazon S3 console, choose the bucket that you created when you set up Amazon SES email
receiving earlier in this tutorial.
3. In the bucket, find the received email. The name of the email will be an alphanumeric string. The
bucket will also contain an item with the name AMAZON_SES_SETUP_NOTIFICATION, which you
can ignore.
4. To download the email to your computer, choose the box to the left of the email, and then choose
Download from the menu.
5. Open the email in a text editor. The email will be in a raw format, which is typically Multipurpose
Internet Mail Extensions (MIME). To decode MIME, you must use your own application.
Step 6: Clean Up
After you have completed this tutorial, you should clean up the following settings and resources to
avoid incurring additional charges.
Amazon S3 Bucket
If you no longer want the Amazon S3 bucket that you created, you can delete it. However, you cannot
delete an Amazon S3 bucket that has items in it, so you must first delete the contents of the bucket,
and then delete the bucket. For more information about deleting folders and buckets, see Delete an
Object and Bucket in the Amazon S3 Getting Started Guide.
Email Content
How do you want Amazon SES to pass you the email content?
Amazon SES can provide you the email content in two ways: it can store the emails in an Amazon
S3 bucket that you specify, or it can send you an Amazon SNS notification that contains a copy of
the email. Amazon SES delivers you the raw, unmodified email, which is typically in Multipurpose
Internet Mail Extensions (MIME) format. For more information about MIME format, see RFC 2045.
How large of a limit on email size do you need?
If you choose to store emails in an Amazon S3 bucket, the maximum email size (including headers)
is 30 MB. If you choose to receive your emails through Amazon SNS notifications, the maximum
email size (including headers) is 150 KB.
How do you want to trigger the processing of your mail?
After your mail is delivered, you will want to process it with your own code. For example, your
application might convert the base 64-encoded email into a displayable format and then make
it available to an end user through an email client. There are a couple of ways you can start the
process:
If your emails are delivered to Amazon S3, your application can listen for Amazon SNS
notifications generated by S3 actions, extract the message ID of the email from the notifications,
and then use the message ID to retrieve the email from Amazon S3.
Alternatively, you can incorporate email processing into your receipt rules by writing a Lambda
function. In this case, your receipt rule should first write the email to Amazon S3, and then trigger
the Lambda function. Lambda actions can be executed synchronously or asynchronously from
within your receipt rules, depending on whether the Lambda function needs to return a result that
influences how other actions are executed. We recommend that you use asynchronous execution
unless synchronous is absolutely necessary for your use case. For more information about AWS
Lambda, see the AWS Lambda Developer Guide.
If your emails are delivered through an Amazon SNS notification by using the SNS action, your
application can listen for Amazon SNS notifications, and then extract the email messages from the
notifications.
Do you want the emails to be encrypted?
Amazon SES integrates with AWS Key Management Service (AWS KMS) to optionally encrypt the
mail it writes to your Amazon S3 bucket. Amazon SES uses client-side encryption to encrypt your
mail before writing it to Amazon S3. This means that you must decrypt the content on your side
after retrieving the mail from Amazon S3. The AWS SDK for Java and AWS SDK for Ruby provide a
client that can handle the decryption for you. Amazon SES can encrypt the emails for you only if you
choose for your emails to be delivered to an Amazon S3 bucket.
Unwanted Mail
At what point in the email-receiving process do you want to reject unwanted mail?
You can reject emails at two points in the email-receiving process: during the SMTP conversation
with the sender's mail server, and after delivery when you can examine the email's properties. You
are not billed for any mail that is rejected during the SMTP conversation, so it is to your advantage
to reject as much unwanted mail as possible at that time. You can reject emails during the SMTP
conversation with IP address filters and receipt rules, both of which are described in Email-Receiving
Concepts (p. 259).
After the SMTP conversation, Amazon SES performs virus scanning, spam scanning, and
authentication checks for DomainKeys Identified Mail (DKIM) and Sender Policy Framework (SPF)
and makes the verdicts available to you so you can decide whether you trust the email. If you don't
API Version 2010-12-01
274
trust the email, you can drop it or send a bounce response to the sender. You will be billed for the
email because this decision point occurs after Amazon SES delivered the email to you.
Do you want to filter your emails based on any property other than recipient or IP address?
You can write complex message-matching conditions using synchronously-executed Lambda
functions (invoked as "RequestResponse") and then incorporate the Lambda functions into your
receipt rules. The return value of the Lambda function indicates whether the evaluation of the receipt
rule and receipt rule set should continue. For example, you can have a receipt rule that drops mail
that Amazon SES flags as spam.
Mail Streams
How do you want to divide your mail stream?
Your domain most likely receives different classes of mail. For example, some of your domain's mail,
such as an email to [email protected], might be intended for a personal inbox. Other mail, such
as an email to [email protected], might be better directed to automated systems instead.
You can use receipt rules to divide your incoming mail so that it can be processed differently. For
information about how to set up receipt rules, see Creating Receipt Rules (p. 279).
Note
Although Amazon SES enables you to verify single email addresses, you must verify a domain
if you want to use Amazon SES for email receiving.
You can also start the domain verification process when you set up receipt rules in Creating Receipt
Rules (p. 279). The recipient list will indicate which recipients are not verified, and enable you to
initiate verification. In any case, you must complete domain verification by publishing a TXT record to
your DNS server, as described in Amazon SES Domain Verification TXT Records (p. 45).
You can confirm that your email address or domain is verified by looking at its status in the Email
Address Identities or Domain Identities list in the Amazon SES console or by using the Amazon
SES GetIdentityVerificationAttributes API.
For more information about attaching policies to AWS KMS keys, see the AWS Key Management
Service Developer Guide.
"Principal": "ses.amazonaws.com",
"SourceAccount": "ACCOUNT-ID-WITHOUT-HYPHENS",
"StatementId": "GiveSESPermissionToInvokeFunction"
}
Note
If you only want to receive mail from a finite list of known IP addresses, then set up a block
list that contains 0.0.0.0/0, and set up an allow list that contains the IP addresses that you
trust. This configuration blocks all IP addresses by default, and only allows mail from the IP
addresses that you explicitly specify.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
2.
3.
4.
In the left navigation pane, under Email Receiving, choose IP Address Filters.
In the content pane, choose Create Filter.
For Filter Name, type a name for the IP address filter. The name must contain less than 64
alphanumeric, hyphen (-), underscore (_), and period (.) characters. The name must start and end
with a letter or number.
API Version 2010-12-01
278
5.
For IP Address Range, type a single IP address or a range of IP addresses that you want to block
or allow, specified in Classless Inter-Domain Routing (CIDR) notation. An example of a single IP
address is 10.0.0.1. An example of a range of IP addresses is 10.0.0.1/24. For more information
about CIDR notation, see RFC 2317.
6.
7.
For information about how to use the CreateReceiptFilter API to create an IP address filter, see
the Amazon Simple Email Service API Reference.
Note
If you do not want to use Amazon SES as your email receiver, simply disable all of your
receipt rule sets. For information about how to disable receipt rule sets, see Managing Receipt
Rule Sets (p. 291).
You can use the Amazon SES console or API to create a receipt rule set.
Using the Amazon SES console
Receipt rules exist in receipt rule sets only, so to create a receipt rule set, you can start by creating
a receipt rule. For more information, see Creating Receipt Rules (p. 279). When you reach the
end of this procedure, you can create a new receipt rule set.
Copy an existing receipt rule set as explained in Managing Receipt Rule Sets (p. 291).
In the left navigation pane, under Email Receiving, choose Rule Sets, and then choose Create a
New Rule Set.
Using the Amazon SES APIUse the CreateReceiptRuleSet API to create an empty receipt
rule set, as described in the Amazon Simple Email Service API Reference. Then, you can use the
Amazon SES console or the CreateReceiptRule API to add receipt rules to it.
Note
Receipt rules exist in receipt rule sets only, which is why you must have at least one receipt
rule set. Each receipt rule can belong to only one receipt rule set.
This topic shows you how to create a receipt rule and describes options for each action type.
API Version 2010-12-01
279
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
2.
In the left navigation pane, under Email Receiving, choose Rule Sets.
3.
Choose a receipt rule set. For example, to go to your active receipt rule set, choose View Active
Rule Set. If you have not created any receipt rule sets yet, you can create one by choosing Create
a New Rule Set.
4.
5.
Use the following procedure to add one or more recipients. Collectively, these recipients are the
condition. You can have a maximum of 100 recipients per receipt rule.
a.
Under Recipients, type an email address or domain that you own. You may use a leading dot
to capture all subdomains of a domain. Using example.com for demonstration purposes:
To match a specific [email protected]. This will match any form of the address
with a label. Addresses that contain labels are of the form [email protected], with
user-specified text between the plus sign (+) and the at sign (@). If you specify a label, then
only messages with the same label will match.
For example, if you want a receipt rule to apply to [email protected], ticket
[email protected], and [email protected], simply set the recipient of the receipt
rule to [email protected]. In contrast, if you set the recipient of the receipt rule to ticket
[email protected], then the rule will only apply to [email protected] it will not
capture [email protected] and [email protected].
To match all addresses within a domain but not its subdomainsexample.com
To match all addresses within all subdomains, but not the domain itself.example.com
(note the leading period)
To match all addresses within a domain and all of its subdomainsTwo recipients:
example.com, .example.com
All recipients within all verified domainsEmpty. (Do not specify any recipients.)
6.
7.
b.
c.
If you have not yet verified the domain of the recipient, choose Verify. To complete domain
verification, you need to publish a TXT record to your DNS server, as described in Verifying
Domains in Amazon SES (p. 41).
d.
Use the following procedure to add one or more actions to the receipt rule.
a.
b.
Choose the action settings. For information about the options for each action, see Action
Options (p. 281).
c.
For Rule Name, type a name for the receipt rule. The name must contain less than 64
alphanumeric, hyphen (-), underscore (_), and period (.) characters. The name must start and
end with a letter or number.
b.
If you want to enable the receipt rule, leave the Enabled option selected.
c.
If you want Amazon SES to reject any incoming emails that are not sent over a connection
that is encrypted with Transport Layer Security (TLS), select TLS.
API Version 2010-12-01
280
d.
If you want Amazon SES to scan incoming emails for spam and viruses, select Enable Spam
and Virus Scanning.
8.
For Rule Set, choose an existing receipt rule set or click Create New Rule Set.
9.
For Rule Position, choose where to place the receipt rule in the ordered list of receipt rules. The
receipt rules are evaluated sequentially.
Action Options
Each receipt rule for Amazon SES email receiving contains an ordered list of actions. The overall
setup procedure for receipt rules is described in Creating Receipt Rules for Amazon SES Email
Receiving (p. 279). This section describes the specific options for each action type.
The action types are the following:
Add Header Action (p. 281)
Bounce Action (p. 281)
Lambda Action (p. 282)
S3 Action (p. 288)
SNS Action (p. 289)
Stop Action (p. 289)
WorkMail Action (p. 290)
Bounce Action
The Bounce action rejects the email by returning a bounce response to the sender and, optionally,
notifies you through Amazon SNS. This action has the following options.
SMTP Reply CodeThe SMTP reply code, as defined by RFC 5321.
SMTP Status CodeThe SMTP enhanced status code, as defined by RFC 3463.
MessageHuman-readable text to include in the bounce email.
Reply SenderThe email address of the sender of the bounced email. This is the address from
which the bounce email will be sent. It must be verified with Amazon SES.
SNS TopicThe name or ARN of the Amazon SNS topic to optionally notify when a bounce email is
sent. An example of an Amazon SNS topic ARN is arn:aws:sns:us-west-2:123456789012:MyTopic.
You can also create an Amazon SNS topic when you set up your action by choosing Create SNS
Topic. For more information about Amazon SNS topics, see the Amazon Simple Notification Service
Developer Guide.
API Version 2010-12-01
281
Note
The Amazon SNS topic you choose must be in the same AWS region as the Amazon SES
endpoint you use to receive email.
You can type in your own values for these fields, or you can choose a template that fills in the SMTP
Reply Code, SMTP Status Code, and Message fields with values based on the bounce reason. The
following templates are available:
Mailbox Does Not Exist SMTP Reply Code = 550, SMTP Status Code = 5.1.1
Message Too Large SMTP Reply Code = 552, SMTP Status Code = 5.3.4
Message Full SMTP Reply Code = 552, SMTP Status Code = 5.2.2
Message Content Rejected SMTP Reply Code = 500, SMTP Status Code = 5.6.1
Unknown Failure SMTP Reply Code = 554, SMTP Status Code = 5.0.0
Temporary Failure SMTP Reply Code = 450, SMTP Status Code = 4.0.0
For additional bounce codes that you might use by typing custom values in the fields, see RFC 3463.
Lambda Action
The Lambda action calls your code through a Lambda function and, optionally, notifies you through
Amazon SNS. This action has the following options.
Lambda functionThe ARN of the Lambda function. An example of a Lambda function ARN is
arn:aws:lambda:us-west-2:account-id:function:MyFunction. For information about AWS Lambda, see
the AWS Lambda Developer Guide.
Invocation typeThe invocation type of the Lambda function. An invocation type of
RequestResponse means that the execution of the function will immediately result in a response,
and a value of Event means that the function will be invoked asynchronously. We recommend that
you use Event invocation type unless synchronous execution is absolutely necessary for your use
case.
Note
There is a 30-second timeout on RequestResponse invocations.
For information about AWS Lambda invocation types, see the AWS Lambda Developer Guide.
SNS TopicThe name or ARN of the Amazon SNS topic to notify when the specified
Lambda function is triggered. An example of an Amazon SNS topic ARN is arn:aws:sns:uswest-2:123456789012:MyTopic. You can also create an Amazon SNS topic when you set up your
action by choosing Create SNS Topic. For more information about Amazon SNS topics, see the
Amazon Simple Notification Service Developer Guide.
Note
The Amazon SNS topic you choose must be in the same AWS region as the Amazon SES
endpoint you use to receive email.
method with two arguments: the first argument is null, and the second argument is a disposition
property that is set to either STOP_RULE, STOP_RULE_SET, or CONTINUE. If the second argument is
null or does not have a valid disposition property, the mail flow continues and further actions and
rules are processed, which is the same as with CONTINUE.
For example, you can stop the receipt rule set by writing the following line at the end of your Lambda
function code:
callback( null, { "disposition" : "STOP_RULE_SET" });
For AWS Lambda code samples, see Lambda Function Examples (p. 286). For examples of highlevel use cases, see Use Case Examples (p. 283).
Input Format
Amazon SES passes information to the Lambda function in JSON format. The top-level object contains
a Records array, which is populated with properties eventSource, eventVersion, and ses. The
ses object contains receipt and mail objects, which are in exactly the same format as in the
Amazon SNS notifications described in Notification Contents (p. 297).
The following is a high-level view of the structure of the input that Amazon SES provides to the Lambda
function.
{
"Records": [
{
"eventSource": "aws:ses",
"eventVersion": "1.0",
"ses": {
"receipt": {
<same contents as SNS notification>
},
"mail": {
<same contents as SNS notification>
}
}
}
]
}
Return Values
Your Lambda function can control mail flow by returning one of the following values:
STOP_RULENo further actions in the current receipt rule will be processed, but further receipt rules
can be processed.
STOP_RULE_SETNo further actions or receipt rules will be processed.
CONTINUE or any other invalid valueThis means that further actions and receipt rules can be
processed.
Rule 1
Recipient list: Empty. This rule will therefore apply to all recipients under all of your verified domains.
Actions
1. Lambda action (synchronous) that returns STOP_RULE_SET if the email is spam. Otherwise, it
returns CONTINUE. See the example Lambda function for dropping spam in Lambda Function
Examples (p. 286).
Rule 2
Recipient list: example1.com
Actions
1. Any action.
Rule 3
Recipient list: example2.com
Actions
1. Any action.
Rule 1
Recipient list: Empty. This rule will therefore apply to all recipients under all of your verified domains.
Actions
1. Lambda action (synchronous) that returns CONTINUE if the email is spam. Otherwise, it returns
STOP_RULE.
2. Bounce action ("500 5.6.1. Message content rejected").
3. Stop action.
Rule 2
Recipient list: example1.com
Actions
1. Any action
API Version 2010-12-01
284
Rule 3
Recipient list: example2.com
Actions
1. Any action
Rule 1
Recipient list: [email protected]
Actions
1. Lambda action (asynchronous).
2. Stop action.
Rule 2
Recipient list: example.com
Actions
1. Any action.
Rule 1
Recipient list: example.com
Actions
1. Lambda action (asynchronous) that writes the event object to a CloudWatch log. The example
Lambda functions in Lambda Function Examples (p. 286) log to CloudWatch.
2. S3 action.
Rule 1
Recipient list: example.com
Actions
API Version 2010-12-01
285
1. S3 action.
2. Lambda action (synchronous) that returns STOP_RULE_SET if the message fails DKIM. Otherwise, it
returns CONTINUE.
Rule 2
Recipient list: [email protected]
Actions
1. Lambda action (asynchronous) that triggers the automated application.
Rule 1
Recipient list: example.com
Actions
1. Lambda action (synchronous) that returns STOP_RULE_SET if the subject line contains the word
"discount". Otherwise, it returns CONTINUE.
Rule 2
Recipient list: [email protected]
Actions
1. S3 action with bucket 1.
2. Lambda action (asynchronous) that triggers the automated application.
3. Stop action.
Rule 3
Recipient list: example.com
Actions
1. S3 action with bucket 2.
2. Lambda action (asynchronous) that processes email for the rest of the domain.
Note
You must first write the email to Amazon S3 using an S3 Action.
var AWS = require('aws-sdk');
var s3 = new AWS.S3();
var bucketName = '<YOUR BUCKET GOES HERE>';
exports.handler = function(event, context, callback) {
console.log('Process email');
API Version 2010-12-01
287
S3 Action
The S3 action delivers the mail to an Amazon S3 bucket and, optionally, notifies you through Amazon
SNS. This action has the following options.
S3 BucketThe name of the Amazon S3 bucket to which to save received emails. You can also
create a new Amazon S3 bucket when you set up your action by choosing Create S3 Bucket.
Amazon SES provides you the raw, unmodified email, which is typically in Multipurpose Internet Mail
Extensions (MIME) format. For more information about MIME format, see RFC 2045.
Important
When you save your emails to an Amazon S3 bucket, the maximum email size (including
headers) is 30 MB.
Object Key PrefixA key name prefix to use within the Amazon S3 bucket. Key name prefixes
enable you to organize your Amazon S3 bucket in a folder structure. For example, if you use Email
as your Object Key Prefix, your emails will appear in your Amazon S3 bucket in a folder named
Email.
KMS Key (if "Encrypt Message" is selected in the Amazon SES console)The customer master
key that Amazon SES should use to encrypt your emails before saving them to the Amazon S3
bucket. You can use the default master key or a custom master key you created in AWS KMS.
Note
The master key you choose must be in the same AWS region as the Amazon SES endpoint
you use to receive email.
To use the default master key, choose aws/ses when you set up the receipt rule in the Amazon
SES console. If you use the Amazon SES API, you can specify the default master key by providing
an ARN in the form of arn:aws:kms:REGION:ACCOUNT-ID-WITHOUT-HYPHENS:alias/
aws/ses. For example, if your AWS account ID is 123456789012 and you want to use the
default master key in the US West (Oregon) region, the ARN of the default master key would be
arn:aws:kms:us-west-2:123456789012:alias/aws/ses. If you use the default master key,
you don't need to perform any extra steps to give Amazon SES permission to use the key.
To use a custom master key you created in AWS KMS, provide the ARN of the master key and
ensure that you add a statement to your key's policy to give Amazon SES permission to use it.
For more information about giving permissions, see Giving Permissions to Amazon SES for Email
Receiving (p. 276).
API Version 2010-12-01
288
For more information about using AWS KMS with Amazon SES, see the AWS Key Management
Service Developer Guide. If you do not specify a master key in the console or API, Amazon SES will
not encrypt your emails.
Important
Your mail is encrypted by Amazon SES using the Amazon S3 encryption client before the
mail is submitted to Amazon S3 for storage. It is not encrypted using Amazon S3 serverside encryption. This means that you must use the Amazon S3 encryption client to decrypt
the email after retrieving it from Amazon S3, as the service has no access to use your AWS
KMS keys for decryption. This encryption client is available with the AWS Java SDK and
AWS Java Ruby only. For more information about client-side encryption using AWS KMS
master keys, see the Amazon Simple Storage Service Developer Guide.
SNS TopicThe name or ARN of the Amazon SNS topic to notify when an email is saved
to the Amazon S3 bucket. An example of an Amazon SNS topic ARN is arn:aws:sns:uswest-2:123456789012:MyTopic. You can also create an Amazon SNS topic when you set up your
action by choosing Create SNS Topic. For more information about Amazon SNS topics, see the
Amazon Simple Notification Service Developer Guide.
Note
The Amazon SNS topic you choose must be in the same AWS region as the Amazon SES
endpoint you use to receive email.
SNS Action
The SNS action publishes the mail using an Amazon SNS notification. The notification includes the
complete email content. This action has the following options.
SNS TopicThe name or ARN of the Amazon SNS topic to which to publish the emails. The
Amazon SNS notifications will contain a raw, unmodified copy of the email, which is typically in
Multipurpose Internet Mail Extensions (MIME) format. For more information about MIME format, see
RFC 2045.
Important
If you choose to receive your emails through Amazon SNS notifications, the maximum email
size (including headers) is 150 KB. Larger emails will bounce. If you anticipate emails larger
than this size, save the emails to an Amazon S3 bucket instead.
An example of an Amazon SNS topic ARN is arn:aws:sns:us-west-2:123456789012:MyTopic.
You can also create an Amazon SNS topic when you set up your action by choosing Create SNS
Topic. For more information about Amazon SNS topics, see the Amazon Simple Notification Service
Developer Guide.
Note
The Amazon SNS topic you choose must be in the same AWS region as the Amazon SES
endpoint you use to receive email.
EncodingThe encoding to use for the email within the Amazon SNS notification. UTF-8 is easier
to use, but may not preserve all special characters when a message was encoded with a different
encoding format. Base64 preserves all special characters. For information about UTF-8 and Base64,
see RFC 3629 and RFC 4648, respectively.
Stop Action
The Stop action terminates the evaluation of the receipt rule set and, optionally, notifies you through
Amazon SNS. This action has the following options.
SNS TopicThe name or ARN of the Amazon SNS topic to notify when the Stop
action is performed. An example of an Amazon SNS topic ARN is arn:aws:sns:usAPI Version 2010-12-01
289
west-2:123456789012:MyTopic. You can also create an Amazon SNS topic when you set up your
action by choosing Create SNS Topic. For more information about Amazon SNS topics, see the
Amazon Simple Notification Service Developer Guide.
Note
The Amazon SNS topic you choose must be in the same AWS region as the Amazon SES
endpoint you use to receive email.
WorkMail Action
The WorkMail action integrates with Amazon WorkMail. If Amazon WorkMail performs all of your email
processing, you will typically not use this action directly because Amazon WorkMail takes care of the
setup. This action has the following options.
Organization ARNThe ARN of the Amazon WorkMail
organization. Amazon WorkMail organization ARNs are in the form
arn:aws:workmail:region:account_ID:organization/organization_ID, where:
region is the region in which you are using Amazon SES and Amazon WorkMail. (You must use
them from the same region.) An example is us-west-2.
account_ID is the AWS account ID. You can find your AWS account ID on the Account page of
the AWS Management Console.
organization_ID is a unique identifier that Amazon WorkMail generates when you create
an organization. You can find the organization ID in the Amazon WorkMail console on the
Organization Settings page of your organization.
An example of a complete Amazon WorkMail organization ARN is arn:aws:workmail:uswest-2:123456789012:organization/m-68755160c4cb4e29a2b2f8fb58f359d7. For information about
Amazon WorkMail organizations, see the Amazon WorkMail Administrator Guide.
SNS TopicThe name or ARN of the Amazon SNS topic to notify when the Amazon
WorkMail action is taken. An example of an Amazon SNS topic ARN is arn:aws:sns:uswest-2:123456789012:MyTopic. You can also create an Amazon SNS topic when you set up your
action by choosing Create SNS Topic. For more information about Amazon SNS topics, see the
Amazon Simple Notification Service Developer Guide.
Note
The Amazon SNS topic you choose must be in the same AWS region as the Amazon SES
endpoint you use to receive email.
Note
You cannot delete the receipt rule set that is currently active.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
2.
In the left navigation pane, under Email Receiving, choose Rule Sets.
3.
In the Inactive Rule Sets list, select the receipt rule set that you want to delete.
4.
From the Actions menu, choose Delete, and then confirm that you want to delete the receipt rule
set.
For information about how to use the DeleteReceiptRuleSet API to delete a receipt rule set, see
the Amazon Simple Email Service API Reference.
Note
To disable email receiving through Amazon SES completely, disable all of your receipt rule
sets.
You can use the Amazon SES console or the SetActiveReceiptRuleSet API to control which rule
set is active.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
2.
In the left navigation pane, under Email Receiving, choose Rule Sets.
3.
In the Inactive Rule Sets list, select the receipt rule set that you want to activate.
4.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
2.
In the left navigation pane, under Email Receiving, choose Rule Sets.
3.
Under Active Rule Set, choose Disable Active Rule Set, and then confirm that you want to
disable the receipt rule set.
For information about how to use the SetActiveReceiptRuleSet API to activate or disable a rule
set, see the Amazon Simple Email Service API Reference.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
2.
In the left navigation pane, under Email Receiving, choose Rule Sets.
3.
4.
In the Copy Rule Set dialog box, type the name you want to assign to the copied receipt rule set.
5.
Choose Copy Rule Set. The copied receipt rule set will appear in the Inactive Rule Sets list.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
2.
In the left navigation pane, under Email Receiving, choose Rule Sets.
3.
In the Inactive Rule Sets list, select the receipt rule set that you want to copy.
4.
5.
In the Copy Rule Set dialog box, type the name you want to assign to the copied receipt rule set.
6.
Choose Copy Rule Set. The copied receipt rule set will appear in the Inactive Rule Sets list.
For information about how to use the CloneReceiptRuleSet API to copy a receipt rule set, see the
Amazon Simple Email Service API Reference.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
2.
In the left navigation pane, under Email Receiving, choose Rule Sets.
API Version 2010-12-01
292
3.
4.
5.
Use the up and down arrows next to the receipt rule names to reorder the receipt rules, and then
choose Save Order.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
2.
In the left navigation pane, under Email Receiving, choose Rule Sets.
3.
In the Inactive Rule Sets list, select the receipt rule set.
4.
5.
Use the up and down arrows next to the receipt rule names to reorder the receipt rules, and then
choose Save Order.
For information about how to use the ReorderReceiptRuleSet API to reorder receipt rules in a
receipt rule set, see the Amazon Simple Email Service API Reference.
Note
The instructions in this section assume that the receipt rule is in the active receipt rule set. To
edit the receipt rules of a disabled receipt rule set, choose a receipt rule set from the Inactive
Rule Sets list. From there, the instructions for editing receipt rules are the same as for the
active receipt rule set.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
2.
In the left navigation pane, under Email Receiving, choose Rule Sets.
3.
In the content pane, choose View Active Rule Set or choose a receipt rule set from the Inactive
Rule Sets list.
4.
In the details pane, choose the receipt rule you want to edit.
5.
In the Edit Rule pane, edit the policy, and then choose Save Rule.
If you want to use the Amazon SES API instead, use the DescribeReceiptRule API to retrieve
the rule, use a text editor to edit the rule, and then use the UpdateReceiptRule API to overwrite
the previous version of the rule. For more information, see the Amazon Simple Email Service API
Reference.
API Version 2010-12-01
293
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
2.
In the left navigation pane, under Email Receiving, choose Rule Sets.
3.
In the content pane, choose View Active Rule Set or choose a receipt rule set from the Inactive
Rule Sets list.
4.
5.
From the Actions menu, choose Delete, and then confirm that you want to delete the receipt rule.
For information about how to use the DeleteReceiptRule API to delete a rule, see the Amazon
Simple Email Service API Reference.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
2.
In the left navigation pane, under Email Receiving, choose Rule Sets.
3.
In the content pane, choose View Active Rule Set or choose a receipt rule set from the Inactive
Rule Sets list.
4.
In the details pane, choose the receipt rule you want to edit.
5.
In the Edit Rule pane, select or clear Enabled, and then choose Save Rule.
If you want to use the Amazon SES API instead, you can use the DescribeReceiptRule API to
retrieve the receipt rule, use a text editor to edit the receipt rule's Enabled field, and then use the
UpdateReceiptRule API to overwrite the previous version of the receipt rule. For more information,
see the Amazon Simple Email Service API Reference.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
2.
In the left navigation pane, under Email Receiving, choose Rule Sets.
3.
In the content pane, choose View Active Rule Set or choose a receipt rule set from the Inactive
Rule Sets list.
4.
5.
6.
In the Copy Rule dialog box, type a new receipt rule name and select the destination receipt rule
set. The new receipt rule will be inserted at the beginning of the receipt rule set, and it will initially
be disabled.
If you want to use the Amazon SES API instead, you can use the DescribeReceiptRule API to
retrieve the receipt rule, use a text editor to edit the receipt rule's name and receipt rule set (if desired),
and then pass that receipt rule to the CreateReceiptRule API. For more information, see the
Amazon Simple Email Service API Reference.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
2.
In the left navigation pane, under Email Receiving, choose Rule Sets.
3.
In the content pane, choose View Active Rule Set or choose a receipt rule set from the Inactive
Rule Sets list.
4.
5.
For information about how to use the SetReceiptRulePosition API to change the position of a
receipt rule in the receipt rule set, see the Amazon Simple Email Service API Reference.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
In the left navigation pane, under Email Receiving, choose IP Address Filters. You will see a list
of your IP address filters.
For information about how to use the ListReceiptFilters API to get a list of your IP address filters,
see the Amazon Simple Email Service API Reference.
Sign in to the AWS Management Console and open the Amazon SES console at https://
console.aws.amazon.com/ses/.
In the left navigation pane, under Email Receiving, choose IP Address Filters.
In the details pane, select the IP address filter.
4.
Choose Delete, and then confirm that you want to delete the IP address filter.
For information about how to use the DeleteReceiptFilter API to delete an IP address filter, see
the Amazon Simple Email Service API Reference.
Important
Changes you make to fix your receipt rule set will apply only to emails that Amazon SES
receives after the update. Emails are always evaluated against the receipt rule set that was in
place at the time the email was received.
The following figure shows the metrics in the CloudWatch console.
Description
notificationType
receipt
content
Note
This field is present only if the
notification was triggered by an SNS
action. Notifications triggered by all
other actions do not contain this field.
receipt Object
The receipt object has the following fields.
Field Name
Description
action
dkimVerdict
Field Name
Description
processingTimeMillis
recipients
spamVerdict
spfVerdict
timestamp
virusVerdict
action Object
The action object has the following fields.
Field Name
Description
type
topicArn
bucketName
objectKey
smtpReplyCode
statusCode
message
sender
Field Name
Description
address from which the bounce message was
sent. Present only for the bounce action type.
functionArn
invocationType
organizationArn
dkimVerdict Object
The dkimVerdict object has the following fields.
Field Name
Description
status
spamVerdict Object
The spamVerdict object has the following fields.
Field Name
Description
status
spfVerdict Object
The spfVerdict object has the following fields.
Field Name
Description
status
virusVerdict Object
The virusVerdict object has the following fields.
Field Name
Description
status
mail Object
The mail object has the following fields.
Field Name
Description
destination
messageId
source
Field Name
Description
timestamp
headers
commonHeaders
headersTruncated
Alert Notification
This section contains an example of an Amazon SNS notification that can be triggered by an S3 action.
Notifications triggered by Lambda actions, bounce actions, stop actions, and Amazon WorkMail actions
are similar. Although the notification contains information about the email, it does not contain the
content of the email itself.
{
"notificationType": "Received",
"receipt": {
"timestamp": "2015-09-11T20:32:33.936Z",
"processingTimeMillis": 406,
"recipients": [
"[email protected]"
],
"spamVerdict": {
"status": "PASS"
},
"virusVerdict": {
"status": "PASS"
},
"spfVerdict": {
"status": "PASS"
},
"dkimVerdict": {
"status": "PASS"
},
"action": {
"type": "S3",
"topicArn": "arn:aws:sns:us-east-1:012345678912:example-topic",
API Version 2010-12-01
301
"bucketName": "my-S3-bucket",
"objectKey": "\email"
}
},
"mail": {
"timestamp": "2015-09-11T20:32:33.936Z",
"source":
"0000014fbe1c09cf-7cb9f704-7531-4e53-89a1-5fa9744f5eb6-000000@amazonses.com",
"messageId": "d6iitobk75ur44p8kdnnp7g2n800",
"destination": [
"[email protected]"
],
"headersTruncated": false,
"headers": [
{
"name": "Return-Path",
"value":
"<0000014fbe1c09cf-7cb9f704-7531-4e53-89a1-5fa9744f5eb6-000000@amazonses.com>"
},
{
"name": "Received",
"value": "from a9-183.smtp-out.amazonses.com (a9-183.smtpout.amazonses.com [54.240.9.183]) by inbound-smtp.us-east-1.amazonaws.com
with SMTP id d6iitobk75ur44p8kdnnp7g2n800 for [email protected]; Fri, 11
Sep 2015 20:32:33 +0000 (UTC)"
},
{
"name": "DKIM-Signature",
"value": "v=1; a=rsa-sha256; q=dns/txt;
c=relaxed/simple; s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug;
d=amazonses.com; t=1442003552; h=From:To:Subject:MIMEVersion:Content-Type:Content-Transfer-Encoding:Date:MessageID:Feedback-ID; bh=DWr3IOmYWoXCA9ARqGC/UaODfghffiwFNRIb2Mckyt4=;
b=p4ukUDSFqhqiub+zPR0DW1kp7oJZakrzupr6LBe6sUuvqpBkig56UzUwc29rFbJF
hlX3Ov7DeYVNoN38stqwsF8ivcajXpQsXRC1cW9z8x875J041rClAjV7EGbLmudVpPX
4hHst1XPyX5wmgdHIhmUuh8oZKpVqGi6bHGzzf7g="
},
{
"name": "From",
"value": "[email protected]"
},
{
"name": "To",
"value": "[email protected]"
},
{
"name": "Subject",
"value": "Example subject"
},
{
"name": "MIME-Version",
"value": "1.0"
},
{
"name": "Content-Type",
"value": "text/plain; charset=UTF-8"
},
{
"name": "Content-Transfer-Encoding",
API Version 2010-12-01
302
"value": "7bit"
},
{
"name": "Date",
"value": "Fri, 11 Sep 2015 20:32:32 +0000"
},
{
"name": "Message-ID",
"value": "<[email protected]>"
},
{
"name": "X-SES-Outgoing",
"value": "2015.09.11-54.240.9.183"
},
{
"name": "Feedback-ID",
"value": "1.us-east-1.Krv2FKpFdWV+KUYw3Qd6wcpPJ4Sv/
pOPpEPSHn2u2o4=:AmazonSES"
}
],
"commonHeaders": {
"returnPath":
"0000014fbe1c09cf-7cb9f704-7531-4e53-89a1-5fa9744f5eb6-000000@amazonses.com",
"from": [
"[email protected]"
],
"date": "Fri, 11 Sep 2015 20:32:32 +0000",
"to": [
"[email protected]"
],
"messageId": "<[email protected]>",
"subject": "Example subject"
}
}
}
"status": "PASS"
},
"dkimVerdict": {
"status": "PASS"
},
"action": {
"type": "SNS",
"topicArn": "arn:aws:sns:us-east-1:012345678912:example-topic"
}
},
"mail": {
"timestamp": "2015-09-11T20:32:33.936Z",
"source": "[email protected]",
"messageId": "d6iitobk75ur44p8kdnnp7g2n800",
"destination": [
"[email protected]"
],
"headersTruncated": false,
"headers": [
{
"name": "Return-Path",
"value":
"<0000014fbe1c09cf-7cb9f704-7531-4e53-89a1-5fa9744f5eb6-000000@amazonses.com>"
},
{
"name": "Received",
"value": "from a9-183.smtp-out.amazonses.com (a9-183.smtpout.amazonses.com [54.240.9.183]) by inbound-smtp.us-east-1.amazonaws.com
with SMTP id d6iitobk75ur44p8kdnnp7g2n800 for [email protected]; Fri, 11
Sep 2015 20:32:33 +0000 (UTC)"
},
{
"name": "DKIM-Signature",
"value": "v=1; a=rsa-sha256; q=dns/txt;
c=relaxed/simple; s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug;
d=amazonses.com; t=1442003552; h=From:To:Subject:MIMEVersion:Content-Type:Content-Transfer-Encoding:Date:MessageID:Feedback-ID; bh=DWr3IOmYWoXCA9ARqGC/UaODfghffiwFNRIb2Mckyt4=;
b=p4ukUDSFqhqiub+zPR0DW1kp7oJZakrzupr6LBe6sUuvqpBkig56UzUwc29rFbJF
hlX3Ov7DeYVNoN38stqwsF8ivcajXpQsXRC1cW9z8x875J041rClAjV7EGbLmudVpPX
4hHst1XPyX5wmgdHIhmUuh8oZKpVqGi6bHGzzf7g="
},
{
"name": "From",
"value": "[email protected]"
},
{
"name": "To",
"value": "[email protected]"
},
{
"name": "Subject",
"value": "Example subject"
},
{
"name": "MIME-Version",
"value": "1.0"
},
{
API Version 2010-12-01
304
"name": "Content-Type",
"value": "text/plain; charset=UTF-8"
},
{
"name": "Content-Transfer-Encoding",
"value": "7bit"
},
{
"name": "Date",
"value": "Fri, 11 Sep 2015 20:32:32 +0000"
},
{
"name": "Message-ID",
"value": "<[email protected]>"
},
{
"name": "X-SES-Outgoing",
"value": "2015.09.11-54.240.9.183"
},
{
"name": "Feedback-ID",
"value": "1.us-east-1.Krv2FKpFdWV+KUYw3Qd6wcpPJ4Sv/
pOPpEPSHn2u2o4=:AmazonSES"
}
],
"commonHeaders": {
"returnPath":
"0000014fbe1c09cf-7cb9f704-7531-4e53-89a1-5fa9744f5eb6-000000@amazonses.com",
"from": [
"[email protected]"
],
"date": "Fri, 11 Sep 2015 20:32:32 +0000",
"to": [
"[email protected]"
],
"messageId": "<[email protected]>",
"subject": "Example subject"
}
},
"content": "Return-Path: <[email protected]>\r\nReceived: from a9-183.smtpout.amazonses.com (a9-183.smtp-out.amazonses.com [54.240.9.183])\r
\n by inbound-smtp.us-east-1.amazonaws.com with SMTP id
d6iitobk75ur44p8kdnnp7g2n800\r\n for [email protected];\r\n Fri,
11 Sep 2015 20:32:33 +0000 (UTC)\r\nDKIM-Signature: v=1; a=rsa-sha256;
q=dns/txt; c=relaxed/simple;\r\n\ts=ug7nbtf4gccmlpwj322ax3p6ow6yfsug;
d=amazonses.com; t=1442003552;\r\n\th=From:To:Subject:MIMEVersion:Content-Type:Content-Transfer-Encoding:Date:Message-ID:FeedbackID;\r\n\tbh=DWr3IOmYWoXCA9ARqGC/UaODfghffiwFNRIb2Mckyt4=;\r\n
\tb=p4ukUDSFqhqiub+zPR0DW1kp7oJZakrzupr6LBe6sUuvqpBkig56UzUwc29rFbJF\r\n
\thlX3Ov7DeYVNoN38stqwsF8ivcajXpQsXRC1cW9z8x875J041rClAjV7EGbLmudVpPX\r
\n\t4hHst1XPyX5wmgdHIhmUuh8oZKpVqGi6bHGzzf7g=\r\nFrom: [email protected]
\r\nTo: [email protected]\r\nSubject: Example subject\r\nMIMEVersion: 1.0\r\nContent-Type: text/plain; charset=UTF-8\r\nContentTransfer-Encoding: 7bit\r\nDate: Fri, 11 Sep 2015 20:32:32 +0000\r
\nMessage-ID: <[email protected]>\r\nX-SESOutgoing: 2015.09.11-54.240.9.183\r\nFeedback-ID: 1.us-east-1.Krv2FKpFdWV
+KUYw3Qd6wcpPJ4Sv/pOPpEPSHn2u2o4=:AmazonSES\r\n\r\nExample content\r\n"
API Version 2010-12-01
305
You can use AWS Identity and Access Management (IAM) with Amazon Simple Email Service
(Amazon SES) to specify which Amazon SES API actions an IAM user, group, or role can perform. (In
this topic we refer to these entities collectively as user.) You can also control which email addresses
the user can use for the "From", recipient, and "Return-Path" addresses of emails.
For example, you can create an IAM policy that allows users in your organization to send email, but not
perform administrative actions such as checking sending statistics. As another example, you can write
a policy that allows a user to send emails through Amazon SES from your account, but only if they use
a specific "From" address.
To use IAM, you define an IAM policy, which is a document that explicitly defines permissions, and
attach the policy to a user. To learn how to create IAM policies, see the IAM User Guide. Other than
applying the restrictions you set in your policy, there are no changes to how users interact with Amazon
SES or in how Amazon SES carries out requests.
Note
You can also control access to Amazon SES by using sending authorization policies. Whereas
IAM policies constrain what individual IAM users can do, sending authorization policies
constrain how individual verified identities can be used. Further, only sending authorization
policies can grant cross-account access. For more information about sending authorization,
see Using Sending Authorization with Amazon SES (p. 196).
If you are looking for information about how to generate Amazon SES SMTP credentials for an existing
IAM user, see Obtaining Your Amazon SES SMTP Credentials (p. 57).
To control general aspects of API usage such as the time period during which a user is permitted to
call the APIs that they are authorized to use.
Note
These email address condition keys apply only to the APIs noted in the following table.
Condition Key
Description
API
ses:Recipients
SendEmail, SendRawEmail
ses:FromAddress
SendEmail, SendRawEmail,
SendBounce
ses:FromDisplayName
SendEmail, SendRawEmail
Condition Key
Description
API
ses:FeedbackAddress
SendEmail, SendRawEmail
}
]
}
The following policy permits a user to call the SendBounce API, but only if the "From" address is
[email protected].
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": ["ses:SendBounce"],
"Resource":"*",
"Condition": {
"StringEquals": {
"ses:FromAddress": "[email protected]"
}
}
}
]
}
For technical discussions about various Amazon SES topics, visit the Amazon SES Blog. To browse
and post questions, go to the Amazon SES Forum.
GetIdentityDkimAttributes
GetIdentityNotificationAttributes
GetIdentityPolicies
GetIdentityVerificationAttributes
GetSendQuota
GetSendStatistics
ListIdentities
ListIdentityPolicies
ListReceiptFilters
ListReceiptRuleSets
ListVerifiedEmailAddresses
PutIdentityPolicy
ReorderReceiptRuleSet
SetActiveReceiptRuleSet
SetReceiptRulePosition
SetIdentityDkimEnabled
SetIdentityFeedbackForwardingEnabled
SetIdentityHeadersInNotificationsEnabled
SetIdentityNotificationTopic
UpdateReceiptRule
VerifyDomainDkim
VerifyDomainIdentity
VerifyEmailAddress
VerifyEmailIdentity
Every log entry contains information about who generated the request. The user identity information
in the log helps you determine whether the request was made with root or IAM user credentials, with
temporary security credentials for a role or federated user, or by another AWS service. For more
information, see the userIdentity field in the CloudTrail Event Reference.
You can store your log files in your bucket for as long as you want, but you can also define Amazon
S3 lifecycle rules to archive or delete log files automatically. By default, your log files are encrypted by
using Amazon S3 server-side encryption (SSE).
You can choose to have CloudTrail publish Amazon SNS notifications when new log files are delivered
if you want to take quick action upon log file delivery. For more information, see Configuring Amazon
SNS Notifications.
You can also aggregate Amazon SES log files from multiple AWS regions and multiple AWS accounts
into a single Amazon S3 bucket. For more information, see Aggregating CloudTrail Log Files to a
Single Amazon S3 Bucket.
"eventVersion": "1.02",
"recipientAccountId": "111122223333",
"requestID": "50f92e80-ab23-11e4-9106-5b36376f9d12",
"requestParameters": {
"identities": [
"example.com"
]
},
"responseElements": null,
"sourceIPAddress": "192.0.2.0",
"userAgent": "aws-sdk-java/unknown-version",
"userIdentity": {
"accessKeyId": "AKIAIOSFODNN7EXAMPLE",
"accountId": "111122223333",
"arn": "arn:aws:iam::111122223333:root",
"principalId": "111122223333",
"type": "Root"
}
},
{
"awsRegion": "us-west-2",
"eventID": "bf695be8-1c67-45b0-8f10-fd56afee09dd",
"eventName": "GetIdentityNotificationAttributes",
"eventSource": "ses.amazonaws.com",
"eventTime": "2015-02-02T21:34:50Z",
"eventType": "AwsApiCall",
"eventVersion": "1.02",
"recipientAccountId": "111122223333",
"requestID": "5133ed92-ab23-11e4-9106-5b36376f9d12",
"requestParameters": {
"identities": [
"example.com"
]
},
"responseElements": null,
"sourceIPAddress": "192.0.2.0",
"userAgent": "aws-sdk-java/unknown-version",
"userIdentity": {
"accessKeyId": "AKIAIOSFODNN7EXAMPLE",
"accountId": "111122223333",
"arn": "arn:aws:iam::111122223333:root",
"principalId": "111122223333",
"type": "Root"
}
},
{
"awsRegion": "us-west-2",
"eventID": "8f9aed63-b03a-4d30-a880-33ae0c6b7786",
"eventName": "GetIdentityVerificationAttributes",
"eventSource": "ses.amazonaws.com",
"eventTime": "2015-02-04T00:57:16Z",
"eventType": "AwsApiCall",
"eventVersion": "1.02",
"recipientAccountId": "111122223333",
"requestID": "c2d23773-ac08-11e4-8ff5-a56a3119e253",
"requestParameters": {
"identities": [
"example.com"
]
API Version 2010-12-01
316
},
"responseElements": null,
"sourceIPAddress": "192.0.2.0",
"userAgent": "aws-sdk-java/unknown-version",
"userIdentity": {
"accessKeyId": "AKIAIOSFODNN7EXAMPLE",
"accountId": "111122223333",
"arn": "arn:aws:iam::111122223333:root",
"principalId": "111122223333",
"type": "Root"
}
},
{
"awsRegion": "us-west-2",
"eventID": "60ef4f01-9826-4fb4-828e-8c36dda81f40",
"eventName": "GetSendQuota",
"eventSource": "ses.amazonaws.com",
"eventTime": "2015-02-04T01:03:27Z",
"eventType": "AwsApiCall",
"eventVersion": "1.02",
"recipientAccountId": "111122223333",
"requestID": "a0760648-ac09-11e4-8ff5-a56a3119e253",
"requestParameters": null,
"responseElements": null,
"sourceIPAddress": "192.0.2.0",
"userAgent": "aws-sdk-java/unknown-version",
"userIdentity": {
"accessKeyId": "AKIAIOSFODNN7EXAMPLE",
"accountId": "111122223333",
"arn": "arn:aws:iam::111122223333:root",
"principalId": "111122223333",
"type": "Root"
}
},
{
"awsRegion": "us-west-2",
"eventID": "0fe5eef3-0c28-4480-808e-307b21404a78",
"eventName": "GetSendStatistics",
"eventSource": "ses.amazonaws.com",
"eventTime": "2015-02-02T21:34:51Z",
"eventType": "AwsApiCall",
"eventVersion": "1.02",
"recipientAccountId": "111122223333",
"requestID": "51644c64-ab23-11e4-9106-5b36376f9d12",
"requestParameters": null,
"responseElements": null,
"sourceIPAddress": "192.0.2.0",
"userAgent": "aws-sdk-java/unknown-version",
"userIdentity": {
"accessKeyId": "AKIAIOSFODNN7EXAMPLE",
"accountId": "111122223333",
"arn": "arn:aws:iam::111122223333:root",
"principalId": "111122223333",
"type": "Root"
}
},
{
"awsRegion": "us-west-2",
"eventID": "6eb8178e-69c3-4a93-8af0-2a5a0f5f209e",
API Version 2010-12-01
317
"eventName": "ListIdentities",
"eventSource": "ses.amazonaws.com",
"eventTime": "2015-02-04T01:03:27Z",
"eventType": "AwsApiCall",
"eventVersion": "1.02",
"recipientAccountId": "111122223333",
"requestID": "a0a4de7a-ac09-11e4-8ff5-a56a3119e253",
"requestParameters": {
"identityType": "Domain",
"maxItems": 10
},
"responseElements": null,
"sourceIPAddress": "192.0.2.0",
"userAgent": "aws-sdk-java/unknown-version",
"userIdentity": {
"accessKeyId": "AKIAIOSFODNN7EXAMPLE",
"accountId": "111122223333",
"arn": "arn:aws:iam::111122223333:root",
"principalId": "111122223333",
"type": "Root"
}
},
{
"awsRegion": "us-west-2",
"eventID": "a18a9745-d06a-43e9-aad0-8eee4de50f48",
"eventName": "ListVerifiedEmailAddresses",
"eventSource": "ses.amazonaws.com",
"eventTime": "2015-02-02T21:34:51Z",
"eventType": "AwsApiCall",
"eventVersion": "1.02",
"recipientAccountId": "111122223333",
"requestID": "51ad8a66-ab23-11e4-9106-5b36376f9d12",
"requestParameters": null,
"responseElements": null,
"sourceIPAddress": "192.0.2.0",
"userAgent": "aws-sdk-java/unknown-version",
"userIdentity": {
"accessKeyId": "AKIAIOSFODNN7EXAMPLE",
"accountId": "111122223333",
"arn": "arn:aws:iam::111122223333:root",
"principalId": "111122223333",
"type": "Root"
}
},
{
"awsRegion": "us-west-2",
"eventID": "da975f45-e68b-4499-8e3f-31a89140e0c9",
"eventName": "SetIdentityDkimEnabled",
"eventSource": "ses.amazonaws.com",
"eventTime": "2015-02-04T01:01:24Z",
"eventType": "AwsApiCall",
"eventVersion": "1.02",
"recipientAccountId": "111122223333",
"requestID": "5731c4ab-ac09-11e4-8ff5-a56a3119e253",
"requestParameters": {
"dkimEnabled": true,
"identity": "example.com"
},
"responseElements": null,
API Version 2010-12-01
318
"sourceIPAddress": "192.0.2.0",
"userAgent": "aws-sdk-java/unknown-version",
"userIdentity": {
"accessKeyId": "AKIAIOSFODNN7EXAMPLE",
"accountId": "111122223333",
"arn": "arn:aws:iam::111122223333:root",
"principalId": "111122223333",
"type": "Root"
}
},
{
"awsRegion": "us-west-2",
"eventID": "5d817126-dadb-436f-b480-f9843289f487",
"eventName": "SetIdentityFeedbackForwardingEnabled",
"eventSource": "ses.amazonaws.com",
"eventTime": "2015-02-02T21:34:51Z",
"eventType": "AwsApiCall",
"eventVersion": "1.02",
"recipientAccountId": "111122223333",
"requestID": "51dd4cf8-ab23-11e4-9106-5b36376f9d12",
"requestParameters": {
"forwardingEnabled": true,
"identity": "example.com"
},
"responseElements": null,
"sourceIPAddress": "192.0.2.0",
"userAgent": "aws-sdk-java/unknown-version",
"userIdentity": {
"accessKeyId": "AKIAIOSFODNN7EXAMPLE",
"accountId": "111122223333",
"arn": "arn:aws:iam::111122223333:root",
"principalId": "111122223333",
"type": "Root"
}
},
{
"awsRegion": "us-west-2",
"eventID": "5d817126-dadb-436f-b480-f9843289f487",
"eventName": "SetIdentityHeadersInNotificationsEnabled",
"eventSource": "ses.amazonaws.com",
"eventTime": "2015-02-02T21:34:51Z",
"eventType": "AwsApiCall",
"eventVersion": "1.02",
"recipientAccountId": "111122223333",
"requestID": "51dd4cf8-ab23-11e4-9106-5b36376f9d12",
"requestParameters": {
"enabled": true,
"identity": "example.com",
"notificationType": "Bounce"
},
"responseElements": null,
"sourceIPAddress": "192.0.2.0",
"userAgent": "aws-sdk-java/unknown-version",
"userIdentity": {
"accessKeyId": "AKIAIOSFODNN7EXAMPLE",
"accountId": "111122223333",
"arn": "arn:aws:iam::111122223333:root",
"principalId": "111122223333",
"type": "Root"
API Version 2010-12-01
319
}
},
{
"awsRegion": "us-west-2",
"eventID": "1a31fd43-55ba-4ce7-b3fe-55659e8144c0",
"eventName": "SetIdentityNotificationTopic",
"eventSource": "ses.amazonaws.com",
"eventTime": "2015-02-04T00:59:21Z",
"eventType": "AwsApiCall",
"eventVersion": "1.02",
"recipientAccountId": "111122223333",
"requestID": "0d553aac-ac09-11e4-8ff5-a56a3119e253",
"requestParameters": {
"identity": "example.com",
"notificationType": "Bounce",
"snsTopic": "arn:aws:sns:us-west-2:123456789100:MyTopic"
},
"responseElements": null,
"sourceIPAddress": "192.0.2.0",
"userAgent": "aws-sdk-java/unknown-version",
"userIdentity": {
"accessKeyId": "AKIAIOSFODNN7EXAMPLE",
"accountId": "111122223333",
"arn": "arn:aws:iam::111122223333:root",
"principalId": "111122223333",
"type": "Root"
}
},
{
"awsRegion": "us-west-2",
"eventID": "aec73edb-6dac-4503-81bb-cca1102f959e",
"eventName": "VerifyDomainDkim",
"eventSource": "ses.amazonaws.com",
"eventTime": "2015-02-02T21:34:52Z",
"eventType": "AwsApiCall",
"eventVersion": "1.02",
"recipientAccountId": "111122223333",
"requestID": "52215ada-ab23-11e4-9106-5b36376f9d12",
"requestParameters": {
"domain": "example.com"
},
"responseElements": {
"dkimTokens": [
"3r2ultrqtelopya3v2apjulcvz7z5n5o",
"yexya47xmy5f3j3e7vgm6pcrcmayu6nu",
"wtlduqduorhmb2vdt2m53yqlcj2m6tpw"
]
},
"sourceIPAddress": "192.0.2.0",
"userAgent": "aws-sdk-java/unknown-version",
"userIdentity": {
"accessKeyId": "AKIAIOSFODNN7EXAMPLE",
"accountId": "111122223333",
"arn": "arn:aws:iam::111122223333:root",
"principalId": "111122223333",
"type": "Root"
}
},
{
API Version 2010-12-01
320
"awsRegion": "us-west-2",
"eventID": "33b3e2eb-7ba3-460b-a127-a5f4cedb4469",
"eventName": "VerifyDomainIdentity",
"eventSource": "ses.amazonaws.com",
"eventTime": "2015-02-04T00:59:21Z",
"eventType": "AwsApiCall",
"eventVersion": "1.02",
"recipientAccountId": "111122223333",
"requestID": "0d9c2ebe-ac09-11e4-8ff5-a56a3119e253",
"requestParameters": {
"disableEmailNotifications": false,
"domain": "example.com"
},
"responseElements": {
"verificationToken":
"pmBGN/7MjnfhTKUZ06Enqq1PeGUaOkw8lGhcfwefcHU="
},
"sourceIPAddress": "192.0.2.0",
"userAgent": "aws-sdk-java/unknown-version",
"userIdentity": {
"accessKeyId": "AKIAIOSFODNN7EXAMPLE",
"accountId": "111122223333",
"arn": "arn:aws:iam::111122223333:root",
"principalId": "111122223333",
"type": "Root"
}
},
{
"awsRegion": "us-west-2",
"eventID": "eb2e1616-2b7b-4cd2-b6dc-29f83fc1789f",
"eventName": "VerifyEmailAddress",
"eventSource": "ses.amazonaws.com",
"eventTime": "2015-02-02T21:34:53Z",
"eventType": "AwsApiCall",
"eventVersion": "1.02",
"recipientAccountId": "111122223333",
"requestID": "5265ddec-ab23-11e4-9106-5b36376f9d12",
"requestParameters": {
"emailAddress": "[email protected]"
},
"responseElements": null,
"sourceIPAddress": "192.0.2.0",
"userAgent": "aws-sdk-java/unknown-version",
"userIdentity": {
"accessKeyId": "AKIAIOSFODNN7EXAMPLE",
"accountId": "111122223333",
"arn": "arn:aws:iam::111122223333:root",
"principalId": "111122223333",
"type": "Root"
}
},
{
"awsRegion": "us-west-2",
"eventID": "5613b0ff-d6c6-4526-9b53-a603a9231725",
"eventName": "VerifyEmailIdentity",
"eventSource": "ses.amazonaws.com",
"eventTime": "2015-02-04T01:05:33Z",
"eventType": "AwsApiCall",
"eventVersion": "1.02",
API Version 2010-12-01
321
"recipientAccountId": "111122223333",
"requestID": "eb2ff803-ac09-11e4-8ff5-a56a3119e253",
"requestParameters": {
"emailAddress": "[email protected]"
},
"responseElements": null,
"sourceIPAddress": "192.0.2.0",
"userAgent": "aws-sdk-java/unknown-version",
"userIdentity": {
"accessKeyId": "AKIAIOSFODNN7EXAMPLE",
"accountId": "111122223333",
"arn": "arn:aws:iam::111122223333:root",
"principalId": "111122223333",
"type": "Root"
}
}
]
}
Use these
credentials
What the
How to get the credentials
credentials consist
of
Note
For security best
practice, use AWS
Identity and Access
Management (IAM)
user access keys
instead of AWS account
access keys. Your AWS
account credentials
grant full access to all
your AWS resources,
so you should store
them in a safe place
and instead use IAM
user credentials for
day-to-day interaction
with AWS. For more
information, see Root
Account Credentials vs.
IAM User Credentials
in the AWS General
Reference.
API Version 2010-12-01
323
If you want to
access the...
Use these
credentials
What the
How to get the credentials
credentials consist
of
SMTP credentials
Note
Although your Amazon
SES SMTP credentials
are different than your
AWS access keys
and IAM user access
keys, Amazon SES
SMTP credentials
are actually a type of
IAM credentials. An
IAM user can create
Amazon SES SMTP
credentials, but the
root account owner
must ensure that the
IAM user's policy
gives them permission
to access the
following IAM actions:
"iam:ListUsers",
"iam:CreateUser",
"iam:CreateAccessKey",
and
"iam:PutUserPolicy".
Amazon SES
console
OR
OR
Note
For security best
practice, use an
IAM user name and
password instead of
an email address and
password. The email
address and password
combination are for
your AWS account, so
you should store them
in a safe place instead
of using them for dayto-day interaction
with AWS. For more
information, see Root
Account Credentials vs.
IAM User Credentials
in the AWS General
Reference.
For more information about different types of AWS security credentials (except for SMTP credentials,
which are used only for Amazon SES), see AWS Security Credentials in the AWS General Reference.
For technical discussions about various Amazon SES topics, visit the Amazon SES Blog. To browse
and post questions, go to the Amazon SES Forum.
Important
For security reasons, Amazon SES does not support HTTP requests. You must use HTTPS
instead.
The following is an example GET request to send a message using the Amazon SES endpoint in the
US West (Oregon) region.
https://email.us-west-2.amazonaws.com?Action=SendEmail&Source=user
%40example.com&Destination.ToAddresses.member.1=allan
%40example.com&Message.Subject.Data=This%20is%20the%20subject
%20line.&Message.Body.Text.Data=Hello.%20I%20hope%20you%20are%20having%20a
%20good%20day.
Important
Because the GET requests are URLs, you must URL-encode the parameter values. For
example, in the preceding example request, the value for the Source parameter is actually
[email protected]. However, the "@" character is not allowed in URLs, so each "@" is
URL-encoded as "%40".
To make the GET examples easier to read, this guide presents them in the following parsed format.
https://email.us-west-2.amazonaws.com
?Action=SendEmail
&Source=user%40example.com
&Destination.ToAddresses.member.1=allan%40example.com
&Message.Subject.Data=This%20is%20the%20subject%20line.
&Message.Body.Text.Data=Hello.%20I%20hope%20you%20are%20having%20a%20good
%20day.
The first line represents the endpoint of the request. After the endpoint is a question mark (?), which
separates the endpoint from the parameters. Each parameter is separated by an ampersand (&).
The Action parameter indicates the action to perform. For a complete list of actions, and the
parameters used with each action, see the Amazon Simple Email Service API Reference.
Some operations take lists of parameters. For example, when you send an email to multiple recipients,
you can provide a list of email addresses. You specify this type of list with param.n notation, where
values of n are integers starting from 1. For example, you would specify the first "To:" address using
Destination.ToAddresses.1, the second with Destination.ToAddresses.2, etc.
In Amazon SES, spaces are not allowed in any of the parameter values. In this guide, any example
Query request parameter value that includes spaces is displayed in one of two different ways:
URL-encoded (as %20).
Represented by a plus sign ("+"). Within a Query request, a plus sign is reserved as a shorthand
notation for a space. (If you want to include a literal, uninterpreted plus sign in any parameter, you
must URL-encode it as %2B.)
Note
Every request must be accompanied by an X-Amzn-Authorization HTTP header. For
more information, see Request Authentication and Amazon SES (p. 329).
Put the parameters and values together as you would for a GET request (with an ampersand
separating each name-value pair). The following example shows a SendEmail request with the
line breaks we use in this guide to make the information easier to read.
Action=SendEmail
&[email protected]
&[email protected]
&Message.Subject.Data=This is the subject line.
&Message.Body.Text.Data=Hello. I hope you are having a good day.
2.
Form-URL-encode the form according to the Form Submission section of the HTML specification.
For more information, see http://www.w3.org/MarkUp/html-spec/html-spec_toc.html#SEC8.2.1.
Action=SendEmail
&Source=user%40example.com
&Destination.ToAddresses.member.1=allan%40example.com
&Message.Subject.Data=This%20is%20the%20subject%20line.
&Message.Body.Text.Data=Hello.%20I%20hope%20you%20are%20having%20a%20good
%20day.
3.
4.
5.
POST / HTTP/1.1
Date: Thu, 26 May 2011 06:49:50 GMT
Host: email.us-west-2.amazonaws.com
Content-Type: application/x-www-form-urlencoded
X-Amzn-Authorization: AWS3
AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE,Signature=lBP67vCvGlDMBQ=dofZxg8E8SUEXAMPLE,Algorit
Content-Length: 230
Action=SendEmail
&Source=user%40example.com
&Destination.ToAddresses.member.1=allan%40example.com
&Message.Subject.Data=This%20is%20the%20subject%20line.
&Message.Body.Text.Data=Hello.%20I%20hope%20you%20are%20having%20a%20good
%20day.
The X-Amzn-Authorization header you provide is the same header you would provide if you sent a
GET request.
Note
Your HTTP client typically adds other items to the HTTP request as required by the version
of HTTP that the client uses. We don't include those additional items in the examples in this
guide.
API Version 2010-12-01
328
POST / HTTP/1.1
Host: email.us-west-2.amazonaws.com
Content-Type: application/x-www-form-urlencoded
Date: Tue, 25 May 2010 21:20:27 +0000
Content-Length: 174
X-Amzn-Authorization: AWS3-HTTPS
AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE,Algorithm=HMACSHA256,Signature=lBP67vCvGl ...
Action=SendRawEmail
&Destinations.member.1=allan%40example.com
&RawMessage.Data=RnJvbTp1c2VyQGV4YW1wbGUuY29tDQpTdWJqZWN0OiBUZXN0DQoNCk1lc3 ...
For technical discussions about various Amazon SES topics, visit the Amazon SES Blog. To browse
and post questions, go to the Amazon SES Forum.
When you use Amazon Simple Email Service (Amazon SES), you connect to a URL that provides an
endpoint for the Amazon SES API or SMTP interface. Amazon SES has endpoints in multiple AWS
regions. To reduce network latency, it's a good idea to choose an endpoint closest to your application.
This topic contains information you need to know when you use Amazon SES endpoints in multiple
AWS regions. It discusses the following subjects:
Amazon SES Endpoints (p. 332)
Selecting a Region to Use with Amazon SES (p. 333)
Sandbox and Sending Limit Increases (p. 334)
Verification (p. 334)
Easy DKIM Setup (p. 334)
Suppression List (p. 335)
Feedback Notifications (p. 335)
SMTP Credentials (p. 335)
Sending Authorization (p. 336)
Custom MAIL FROM Domains (p. 335)
Email Receiving (p. 336)
For general information about AWS regions, see AWS Regions and Endpoints in the AWS General
Reference.
Region name
API (HTTPS)
endpoint
SMTP endpoint
US East (N.
Virginia)
email.usemail-smtp.us-east-1.amazonaws.com
east-1.amazonaws.com
US West
(Oregon)
email.usemail-smtp.us-west-2.amazonaws.com
west-2.amazonaws.com
EU (Ireland)
email.euemail-smtp.eu-west-1.amazonaws.com
west-1.amazonaws.com
inbound-smtp.us-east-1.amazonaws.com
US West (Oregon)
inbound-smtp.us-west-2.amazonaws.com
EU (Ireland)
inbound-smtp.eu-west-1.amazonaws.com
Verification
Before you send email using Amazon SES, you must verify that you own your email address or
domain with Amazon SES. Verification status for each region is separate, as described in the following
sections.
Domain Verification
Like email address verification, domain verification applies to each region separately. You must
perform the domain verification procedure for each region in which you want to send from a given
domain. For example, if you want to send email from example.com from both the US West (Oregon)
region endpoint and the US East (N. Virginia) region endpoint, you must add two TXT records to your
DNS settings one record for each region. You generate these records by using the Amazon SES
console with the appropriate region selected, or the Amazon SES API endpoint that corresponds to
the region you want. For more information about verifying domains, see Verifying Domains in Amazon
SES (p. 41).
generate TXT records, add the TXT records to your DNS settings, and then use the Amazon SES API
or the Amazon SES console to enable DKIM signing for your chosen sending identity (email address
or domain) within that region. For more information about setting up Easy DKIM, see Easy DKIM in
Amazon SES (p. 94).
Suppression List
Although each region has a separate suppression list, if you remove an address from the suppression
list of one region, the address is removed from the suppression list of all regions. You remove
addresses from the suppression list by using the Amazon SES console. For more information about the
suppression list, see Removing an Email Address from the Amazon SES Suppression List (p. 236).
Feedback Notifications
There are two important points to note about setting up feedback notifications in multiple regions:
Verified identity settings, such as whether you receive feedback by email or through Amazon Simple
Notification Service (Amazon SNS), apply only to the region in which you set them. For example, if
you verify [email protected] in the US West (Oregon) and US East (N. Virginia) regions and you
want to receive bounced emails via Amazon SNS notifications, you must use the Amazon SES API
or the Amazon SES console to set up Amazon SNS feedback notifications for [email protected] in
both regions.
Amazon SNS topics you use for feedback forwarding must be within the same region in which you
are using Amazon SES.
SMTP Credentials
You can use the same set of SMTP credentials in all regions. For more information about SMTP
credentials, see Obtaining Your Amazon SES SMTP Credentials (p. 57).
feedback-smtp.us-east-1.amazonses.com
US West (Oregon)
feedback-smtp.us-west-2.amazonses.com
EU (Ireland)
feedback-smtp.eu-west-1.amazonses.com
API Version 2010-12-01
335
Sending Authorization
The delegate sender must send the emails from the AWS region in which the identity owner's identity
is verified. The sending authorization policy that gives permission to the delegate sender must be
attached to the identity in that region. For more information about sending authorization, see Using
Sending Authorization with Amazon SES (p. 196).
Email Receiving
When you receive email with Amazon SES, all of the resources that you use must be in the same
region as the Amazon SES endpoint.
Note
For a list of endpoints for Amazon SES email receiving, see Email Receiving
Endpoints (p. 333).
For example, if you use the Amazon SES endpoint in US West (Oregon), then any Amazon S3 bucket,
Amazon SNS topic, AWS KMS key, and Lambda function that you use must also be in US West
(Oregon). Similarly, to receive mail with Amazon SES within a region, you must have an active receipt
rule set within that region.
For technical discussions about various Amazon SES topics, visit the Amazon SES Blog. To browse
and post questions, go to the Amazon SES Forum.
Sending Limits
Note
Sending limits are based on recipients rather than on messages.
Limit
Description
Note
The rate at which Amazon SES accepts your
messages might be less than the maximum
send rate.
To increase your sending limits, open an SES Sending
Limit case in Support Center. For more information, see
Moving Out of the Amazon SES Sandbox (p. 54).
Message Limits
Limit
Description
Limit
Description
Description
Sender address
Recipient address
Description
50
10
10
Description
Description
100
10
100
20
100
30 MB
150 KB
General Limits
The following table lists limits that apply to both email sending and email receiving.
Description
For technical discussions about various Amazon SES topics, visit the Amazon SES Blog. To browse
and post questions, go to the Amazon SES Forum.
Description
Contact Us
AWS Glossary
Resource
Description
Conditions of Use
For technical discussions about various Amazon SES topics, visit the Amazon SES Blog. To browse
and post questions, go to the Amazon SES Forum.
For technical discussions about various Amazon SES topics, visit the Amazon SES Blog. To browse
and post questions, go to the Amazon SES Forum.
Content-ID
Content-Language
Content-Length
Content-Location
Content-MD5
Content-Transfer-Encoding
Content-Type
Date (Note: Amazon SES overrides any Date header you provide with the time that Amazon SES
accepts the message. The time zone of the Date header is UTC.)
Delivered-To
Disposition-Notification-Options
Disposition-Notification-To
DKIM-Signature
DomainKey-Signature
Errors-To
From
Importance
In-Reply-To
Keywords
List-Archive
List-Help
List-Id
List-Owner
List-Post
List-Subscribe
List-Unsubscribe
Message-Context
Message-ID (Note: Amazon SES overrides any Message-ID header you provide.)
MIME-Version
Organization
Original-From
Original-Message-ID
Original-Recipient
Original-Subject
Precedence
Priority
References
Reply-To
Return-Path (Note: After Amazon SES uses any Return-Path header you provide, it removes that
header before sending the email.)
Return-Receipt-To
Sender
Solicitation
Sensitivity
Subject
Thread-Index
Thread-Topic
API Version 2010-12-01
343
User-Agent
VBR-Info
Note
Some ISPs have further limitations (e.g., regarding archived attachments), so we recommend
testing your email sending through major ISPs before you send your production email.
.fxp
.gadget
.hlp
.hta
.inf
.ins
.isp
.its
.js
.jse
.ksh
.lib
.lnk
.mad
.maf
.mag
.mam
.maq
.mar
.mas
.mat
.mau
.mav
.maw
.mda
.mdb
.mde
.mdt
.mdw
.mdz
.msc
.msh
.msh1
.msh2
.mshxml
.msh1xml
.msh2xml
.msi
.msp
.mst
.ops
.pcd
.pif
.plg
.prf
.prg
.reg
.scf
.scr
.sct
.shb
.shs
.sys
.ps1
.ps1xml
.ps2
.ps2xml
.psc1
.psc2
.tmp
.url
.vb
.vbe
.vbs
.vps
.vsmacros
.vss
.vst
.vsw
.vxd
.ws
.wsc
.wsf
.wsh
.xnk
Change
Description
Date Changed
New feature
November 21,
2016
New feature
November 2,
2016
Service
update
September 15,
2016
New feature
New feature
March 14,
2016
New feature
September 28,
2015
New feature
July 8, 2015
New feature
May 7, 2015
Service
update
April 8, 2015
Service
update
February 25,
2015
Change
Description
Date Changed
December 15,
2014
New feature
New feature
March 19,
2014
New feature
January 29,
2014
New feature
January 15,
2014
New feature
November 6,
2013
August 22,
2013
New feature
New feature
May 8, 2013
New feature
March 4, 2013
February 4,
2013
January 21,
2013
December 12,
2012
November 9,
2012
New feature
October 3,
2012
New feature
New feature
New feature
New feature
New feature
March 7, 2012
New feature
February 22,
2012
New feature
December 13,
2011
Change
Description
Date Changed
New feature
November 17,
2011
New feature
Initial release
January 25,
2011
For technical discussions about various Amazon SES topics, visit the Amazon SES Blog. To browse
and post questions, go to the Amazon SES Forum.