With the big news that Mandrill is dropping its free plan, I decided it is time to move on and find a new transactional email service. While it looks like there are a handful of competitors offering a free introductory plan, I decided to go to Amazon Simple Email Service (SES), a service included in Amazon Web Services (AWS) suite of products.
Note that some of this is “complicated techy stuff.” If it looks like Chinese to you and you want help, I am available to take care of this for you.
What is Amazon SES and What Does it Cost?
Amazon Simple Email Service is a transactions email service provided by Amazon. It can integrate with any website, server, or email program using SMTP (Simple Mail Transfer Protocol) or more complex apps using an API (Application Programming Interface). Today, we are going to focus on using Amazon SES with SMTP to send WordPress emails or emails from your website’s email address via Gmail.
The cost for using Amazon SES is negligible for most bloggers and small business owners. For the first year on Amazon AWS, SES is included in the free tier for up to 62,000 messages per month sent and 1,000 per month received. After that, the cost is .10 cents per 1,000 emails, with an extra charge of .12 cents per GB of attachments sent.
For most bloggers and small businesses, that is going to be incredibly cheap. We’re talking $1 per 10,000 messages sent. That is much cheaper than the cost of MailChimp’s lowest paid account to continue using Mandrill. What a bargain! Thanks Amazon!
How to Send WordPress Emails Through Amazon SES
First, sign into the AWS console. If you do not already have an account, you can sign up using your existing Amazon.com account or a create a new one. Once you are signed in, look for the Simple Email Service icon to open the SES settings. Be care about just randomly clicking and adding or removing services.
Important Note: You can totally screw up your AWS account or rack up lots of charges if you don’t know what you are doing. For this purpose, you ONLY need the SES interface.
When you open the SES interface, you will see links to lots of documentation and options. You don’t have to worry about most of that unless you want to do something more powerful or customized than what we are doing here.
To start sending from your WordPress site, you first need to add your domain to AWS and setup some records with your DNS, which can typically be accessed through your domain registrar or hosting account. If you use Cloudflare, your DNS is hosted there.
Setting Up Your Domain for SES Sending
When you open the Domains menu on the left, click the big blue button at the top to “verify a new domain.” In the box that pops up, enter your domain and check the box to get copies of your DKIM records. When that is done, click the box to verify your domain.
The next screen that comes up is very important. You will input this information at your registrar. Adding your DKIM records and TXT records will tell both Amazon SES and anyone receiving an email from your site that the email really came from you, and was not sent by a spammer or phishing scam.
Treat the information on this page like a password to your email account. Keep it confidential and only share it with a trusted tech support person or developer. Because I don’t own a site call yourdomain.com, the values below are essentially worthless.
Next, pull up your DNS editor for your website. You may find this at your hosting company or in CPanel at your hosting company. Below, you can find links with instructions to add the above DNS records. For the DKIM settings, click the “download record set as CSV” link to view the entire string for each CNAME you have to add.
Unless you want to receive emails through SES, you do not have to add the MX record.
Here’s how to add the DNS records at some popular registrars and hosting companies:
Once the DNS is updated, Amazon SES will automatically detect the records and mark your domain as verified. Right now, it may still show “pending verification.” If that is the case, this is a good opportunity to go grab a snack, like some Jo Jo’s from Trader Joes. Or maybe take a nap. But not too long of a nap. My verification only took a few minutes.
Verify the Sending Email Address with Amazon SES
Once your domains are verified, the next step is to verify any email address you will want to send from. This may be your business email, personal email, or something like email@example.com. It doesn’t matter. As long as the email address exists, you can receive emails there, and you have verified the domain, you can add the address. You can add as many as you’d like.
To verify an email address, click on the email menu on the left, and then the big blue “verify a new email address” button at the top. Add the email to the form, then check your inbox for a confirmation link.
After you click the confirmation link in the email, your address is all set to send with Amazon SES once your account is activated.
Get Amazon SES Sending Activated
Amazon does not just let anyone setup SES and start blasting emails out into the internet. To help keep spammers at bay, each account is manually approved. This process is called “moving out of the Amazon SES sandbox.”
Amazon has a guide to getting moved from the sandbox into production, where you can send live emails. Basically, you head to this form and fill it out. I requested 10,000 sends per day, which is about 9,950 more than I need. They approved me for 50,000 per day with a maximum of 14 sends per second.
The approval took a few hours. While you are waiting, find something else to do, like rock climbing (NSFW video link, but it made me laugh). Amazon will send you an email when your account has been moved to production.
Add the SMTP Plugin to WordPress
Next, we are going to get WordPress ready to send the emails via Amazon SES instead of your web hosting server. This is valuable for any website owner, particularly if you use shared hosting.
Each server and hosting account has an IP address. Large email services like Gmail, Hotmail, and Yahoo! mail look at the IP address where emails come from when going to their users’ accounts. If someone else on your server sends lots of bad emails, or too many are sent close together, you may get throttled, sent to spam, or just blocked all together. With a transactional email service like SES, you don’t have to worry about that issue on shared hosting.
Additionally, hosting servers are optimized for hosting above anything else. Amazon SES and other transactional email services are optimized for sending email. You wouldn’t put an ice cream truck in the Indy 500 or use a race car to deliver ice cream. Use the same logic here for email and hosting.
There are a whole bunch of SMTP plugins available. I use WP Mail SMTP, which is free and works great. You can download the file from the WordPress.org link, or go through your WordPress dashboard to add a plugin to WordPress.
Get Your SMTP Credentials for Amazon SES
We are headed back to the AWS Console and Amazon SES dashboard for the next step. There are three important links and information spots to notice.
First, click on the SMTP menu, circled in green in the image above. Next, click on the blue “Create My SMTP Credentials” button to get the credentials for your site.
In the next screen, you can use the default username (what I did) or pick a custom name. What you use here will never be seen by anyone else, and the default name is random and secure. Copy that name somewhere safe and then click the button at the bottom to create the credentials.
Click the button to see your credentials, and make a copy of the username and password somewhere safe. You can also use the button at the bottom of the screen to download your credentials to your computer. Finally, head back to the SMTP settings page and note the server name and ports.
Connect WordPress to Amazon SES with SMTP
We’re on the final stretch! Stand up, stretch your legs, shake out your arms, and get ready to finish things up.
In the WordPress Dashboard, you will find a new option in the Settings menu (on the left side) for Email. Click on that to open your email settings.
Start at the top and fill in your information down the list.
- In the first section, add your sending email address and the name you want the email to display for the recipient.
- Next, make sure the radio button for “Send all WordPress emails via SMTP” is selected.
- Check the box to make the return path the same as the from email address so you get replies.
- Enter the server name from the Amazon SES SMTP settings page and choose port 465 – 465 is a secure SMTP connection
- For encryption, choose “Use SSL encryption.”
- For authentication, choose ” Yes: Use SMTP authentication.”
- Enter the user and password from the drop down arrow or downloaded file in the prior section.
- Hit the “Save Changes” button!
At this point, everything should be setup and working. To make sure it is working, go to the bottom section and enter your personal email address (or any email different from what you used to send) and fire off a test email. You should receive in within a minute or so.
If you don’t receive the test email, go back and make sure your server, user, and passwords are all correct and that you didn’t miss any settings in the WordPress SMTP settings page.