How to set up WordPress to use Amazon SES

#

Running a site that sends a lot of emails, like an ecommerce site or a membership site, needs a reliable service to help keep up with the volume of emails you send. Though, if you use an existing email provider through SMTP (such as Gmail), you’ll often hit the rate limits. The good news is you can set up WordPress to use Amazon SES – it’s a top-notch way to add a dedicated email service to your site.

For this tutorial, we’ll look at how to set up WordPress to use Amazon SES. We’ll also introduce some of the solutions to help you integrate both platforms along the way.

Why Use Amazon SES?

In short, standard personal email services such as Gmail aren’t designed for mass emailing, especially when you add transactional emails into the mix. You need a lot of bandwidth to send out invoices, password reset emails, support requests, and much more.

The danger is that you’ll hit the rate limit of your service, which isn’t structured to handle the volume and frequency of transactional emails. With Amazon Simple Email Service (SES), you can leverage big tech infrastructure for your WordPress emails.

A big draw of Amazon SES is the reasonable pricing. Amazon SES starts at a flat rate of $0.10 per 1,000 emails sent. It doesn’t matter where you are sending the emails from, the price remains the same. There’s also a free tier that lets you send 62,000 messages per month, but this is only from an application hosted in Amazon EC2. If you wanted to take advantage of this, you could spin up an Amazon EC2 server with SpinupWP and use Amazon SES to send WordPress emails for a cost-effective price.

Toy Story Meme showing SpinupWP & Amazon SES together

Here’s how Amazon SES compares to other services. We’ll start with a small number of monthly emails, say 20,000 emails per month:

  • Amazon SES: $2
  • Mailgun: $12–16 (based on the introductory offer of 5,000 emails per month for three months)
  • MailJet: $9.65
  • SendGrid: $14.95
  • SendinBlue: $39
  • Postmark: $22.50

As you’d expect, higher sending volumes can save you some money. Here are the costs of sending 200,000 emails per month on the same services:

  • Amazon SES: $20
  • Mailgun: $160
  • MailJet: $166.95
  • SendGrid: $89.95
  • SendinBlue: $229
  • Postmark: $163.75

If you are running a site with a very high volume of emails, say 1,000,000 emails a month, this is what each service would cost:

  • Amazon SES: $100
  • Mailgun: $800
  • MailJet: $398.95*
  • SendGrid: $449
  • SendinBlue: $599
  • Postmark: $535

(The MailJet Pricing is for 900,000 emails. If you want to go above that, you need to contact them for a quote.)

The difference is dramatic. Part of the reason for this is because other services often use tiered pricing. As such, there may be times where you’re on a tier not suited to your needs. With some providers, you’ll have ‘emails in hand’, so to speak. It’s wasteful and gives you more reason to switch your provider.

Amazon SES’ Parent Infrastructure

Another big advantage of Amazon SES is that it runs on Amazon Web Services (AWS)! AWS has made a huge impression in cloud computing since 2002. Its services are trusted by tiny businesses, all the way up to enterprise-level behemoths.

Given this, AWS is a reliable platform with dozens of services to help you run your online business. Also, several of these services can integrate directly with Amazon SES:

  • Amazon EC2
  • Amazon Simple Notifications System
  • Amazon S3
  • AWS Cloudtrail

You can configure these services to your liking, and there is ample documentation on integrating everything. As such, it’s up to you how you want your application or WordPress website to run on the platform.

How to Set Up WordPress for Amazon SES in 3 Steps

Let’s get down to business! Below, we’ll show you how to set up WordPress and Amazon SES, along with how our WP Offload SES plugin can help.

1. Sign Up to AWS

First, you’ll need an AWS account and access to its console. You’ll also need to create an Identity and Access Management (IAM) user to generate access keys for Amazon SES.

To do this, go to the Identity and Access Management console, and click Users in the sidebar, and then click the Add User button. Here, add a user name and check the Programmatic access box to grant access to the AWS APIs.

Add A New IAM User

Once you click through to the “Permissions” screen, choose Attach existing policies directly. Type “AmazonSESFullAccess” in the search area to filter the policies, then check the “AmazonSESFullAccess” policy in the result list, to grant the user full access. Do the same for “AmazonSNSFullAccess”, so the user can access services related to Amazon’s notifications system, Amazon SNS.

Attach IAM Policies

You can skip the “Tags” screen, and confirm the correct permissions have been added on the “Review” screen.

Review IAM User

After creating the user, you’ll be given an access key ID and a secret key. Copy these down, as we’ll need them later.

IAM User Access Keys

2. Remove Sending Restrictions From Your Account

When you first sign up, your Amazon SES account is placed in Sandbox mode. This means you can only send emails to verified email addresses. As such, you’ll need to open a request to lift the restriction in order to send to ‘unverified’ emails. It can take around a day or two, so it’s best to start this as soon as possible.

It’s vital to follow the guide and be descriptive to help the AWS approve your request. Once they do so, you’ll get a confirmation email.

3. Configure Your WordPress Site to Send Emails Through SES

When you’re out of Sandbox mode, you can start to send emails through Amazon SES. There are two ways to do this:

  • Configure your site to send emails through SMTP
  • Use the SES API to send your emails. This is Amazon’s recommended approach.

On the whole, the SMTP settings will be simpler to set up, but will be slower since the connection requires multiple authentication requests. In contrast, API calls can send batch requests, which is definitely beneficial in this case.

To help your WordPress site and Amazon SES account work together, you could use our WP Offload SES WordPress plugin:

The WP Offload SES plugin

The best place to start is with WP Offload SES Lite. This gives you almost all of the functionality of its big brother, and also includes a sending queue. This is helpful when Amazon SES is down (or even more likely, there are networking issues between your server and Amazon SES), as the emails will stay in the queue even if they fail to send and you won’t lose any emails. WP Offload SES will even automatically retry sending failed emails for you.

We also have a Setup Wizard to help with the whole process. You’ll need about 30 minutes to go through the entire process. The first step outlines the IAM user process we mentioned earlier:

The first step in the WP Offload SES setup wizard

If you click the Next button, you’ll want to follow the dialog to enter your generated access keys. You won’t be able to move on until you enter them in your wp-config.php file, or in the database:

Entering your access keys into WP Offload SES Lite

Once you’ve done this, you’ll work on removing Sandbox mode. At every step, you can skip directly to the Settings screen:

The WP Offload SES Settings page

The fields in the “General Settings” section are simple to fill out:

  • WordPress Notification Email. This is what the plugin will use when sending emails.
  • WordPress Notification Name. This is the name the user will see in the “From” field.
  • Reply To. Of course, this is the email address a user will reply to.
  • Return Path. This is used for email bounces and complaints.

If your site receives a lot of contact form submissions and you want to be able to reply direct from them, you can set the “Return Path” to headers, or leave that field blank. This helps contact forms and other plugins override the reply address field.

When you’re ready, toggle the Send Mail Using SES button within the “General Settings”:

The Send Mail Using SES button.

You can send a test email from the Send Test Email section of the settings menu to test everything:

The Send Test Email screen.

Once you have things up and running, there’s only one more step. We’ll tackle this next.

4. Set up DomainKeys Identified Mail (DKIM) Records and Your Sender Policy Framework (SPF)

It’s important to make your emails as ‘deliverable’ as possible. This will get you into a user’s inbox, without meeting the Spam folder. What’s more, it’s a good idea to configure each email and sending domain to help here.

Because a web host’s default email sending service can’t automatically configure DKIM or SPF and send emails via your domain, they’re not the best or most reliable of services. The good news is that we cover how to set up DKIM records with Amazon SES in the WP Offload SES documentation.

While you’re looking into DKIM, it’s a good idea to also set your SPF record too. It’s a validation technique to help prevent email spoofing. The emails you send through Amazon SES pass this check by default. Though, you may want to see your own records. In these cases, you should check out Amazon’s documentation, as it will run you through the necessary steps.

In most cases though, you won’t need to touch SPF settings.

Wrapping Up

If you need to send transactional emails, your personal email service isn’t going to cut it. Using WP Offload SES with Amazon SES is ideal, and you’re able to manage it all from your site’s dashboard.

In this article, we offered the basics of using Amazon SES with WordPress. Though, if you’d like to make further tweaks, the documentation contains a wealth of information. It’s also possible to set up some unique workflows that can scale for large applications.

Do you use a transactional email service already, and if so, are you tempted with a switch to Amazon SES? Let us know in the comments section below!

About the Author

Matt Shaw

Matt is a WordPress plugin developer located near Philadelphia, PA. He loves to create awesome new tools with PHP, JavaScript, and whatever else he happens to get his hands on.