How to: Set up an SMTP mail relay using Amazon Simple Email Service

Whether you need an SMTP server to relay mail for a particular application like WordPress, server monitoring software, a ticketing system, or even a copy machine Amazon has a service that is much easier to configure and use than setting up an SMTP server on a spare Windows or Linux box that you may have lying around. For a few cents a month you can use their highly reliable service to meet almost any mail relay need that you may run into.

UPDATE: Amazon just released a Domain Verification feature that can be used in combination with Verified Senders. Verifying a domain eliminates you from having to verify each email account you would like to send mail as. For more information, see their blog post.

To configure this service you first need an AWS (Amazon Web Services) account. If you do not have one, head over to Amazon to sign up. You will be required to enter your credit card information, but you will only be billed once you start using resources in the AWS cloud.

After your account is created follow these steps to configure SES (Simple Email Service). These instructions have been copied and condensed from Amazon’s SES Getting Started Guide.

First, we need to create the AWS Access Keys (in this case, the SMTP username and password) that will allow your application or device to login to AWS.

To get your AWS access keys

  1. Go to http://aws.amazon.com, click Account, and then click Security Credentials.
  2. Navigate to the Access Credentials section of the page, and click the Access Keys tab.
  3. Follow the on-screen instructions.

These next steps will walk you through verifying email addresses that are allowed to be impersonated by Amazon when sending emails. When you first sign up you are in a “sandbox” environment. While your SES account is in this state you will need to verify email addresses that you would like to send mail to until you are granted production access (please see the instructions later on in this post).

To verify your email address

  1. Go to the AWS Management Console. Log in with the email address and password you used when you signed up for Amazon SES.
  2. In the Amazon SES console, click Verified Senders. If you are a new Amazon SES user, the list should be empty.
  3. To start the verification process, click Verify a New Sender.
  4. In the Verify a New Sender dialog box, type your email address in the indicated field, and then click Submit.
  5. Sign in to your email client, and then find the message from Amazon SES asking you to confirm that you are the owner of this email address.
  6. To verify your email address, click the link in the email.

UPDATE: Amazon now allows you to verify your entire domain. See this article for more information.

Once these instructions have been completed, you can begin testing. Just keep in mind the following restrictions (that are only in place until you are granted production access):

  • You are only allowed to send to email addresses on the Verified Senders tab in the SES console.
  • Only one message can be sent per second
  • Only 200 messages can be sent within 24 hours

You can find your account’s SMTP settings under the SES tab, then under the SMTP Settings link on the left navigation bar. Here you will find the SMTP server name, port numbers, and TLS settings for your outgoing SMTP server configuration. You will also need to specify the SMTP username and password that you were given when you created your access keys in the first set of instructions in this article. Go ahead and enter in all this information and try sending a test email from your application or device.

Once you confirm that you can receive mail at one of the addresses on the verified senders tab you can request production access here. This will remove all of the restrictions mentioned in the bulleted list above with the exception of requiring a verified sender to be specified. Production access will allow you to send email to any recipient without them being verified but you can only send “as” an address that has been confirmed and verified on this section of SES.

Please leave a comment with any questions or see the Amazon SES Getting Started Guide for more details.

comments powered by Disqus