Should I use SMTP to send email from WordPress?
On my WordPress websites I’ve used Mandrill to send all emails in place of the default way that WordPress sends emails. WordPress by default uses the host server to send emails (such as submitted contact forms) which proves very unreliable. One could use SMTP with your default email account credentials (by default I mean Google Apps, Microsoft Office 365, Yahoo Mail etc.) however this becomes a real maintenance problem should you change your password. Using a transactional email provider makes sending email from your website extremely reliable and free of issues.
Which transactional email provider should I use with WordPress?
Fortunately there are many very good transactional email services that work well with WordPress. SendGrid, MailGun, Postmark and various others come to mind however when it comes to value for money and reputation it takes alot to beat AWS Amazon SES.
I’ve used AWS services for many years (especially EC2 virtual servers, S3 storage, CloudFront CDN and Route 53 DNS hosting) and have found them very cost effective and reliable. Being a Mailchimp Expert and delivering Mailchimp training, my first choice was to use Mandrill however, now that Mandrill is no longer cost effective for my needs, it’s Amazon SES for my transactional sending needs.
How to setup Amazon SES in WordPress
Setting up Amazon SES to send all your WordPress email is simple enough. Just follow the instructions below.
Setup Amazon SES
The most difficult part of the process is setting up Amazon SES. This however really isn’t all that complicated.
- Login to the AWS Console (if you don’t have an AWS account then you’ll need to create one).
- Click SES (under Application Services).
- Click Identity Management.
- To the left of your screen click Domains then the Verify a New Domain button. Follow the instructions to verify your domain.
- To the left of your screen click Email Addresses then the Verify a New Email Address button. Follow the instructions to verify your email address.
- Click SMTP settings. Make a note of the server name and the various port numbers.
- Still in SMTP settings, click Create my SMTP Credentials and, once the SMTP credentials have been created, make a note of the username and password.
You’ll notice above that Amazon SES requires that you enter SMTP details to send with Amazon SES (as opposed to API credentials that some other transactional email providers prefer you use). Using the SES SMTP details works well as you likely won’t need to change your password in the future.
Note: Please be aware that by default SES will only send to email addresses that you’ve verified per step 5 above.
Setup WordPress to send with SES
We’re now ready to move onto the WordPress part of the setup. Follow the steps below.
- Login to your WordPress dashboard.
- Install and activate the WP Mail SMTP plugin (any good similar plugin will do the trick but the instructions below use this plugin).
- Go to Settings -> Ex SMTP Mail Setting.
- Enter your name in the From Name field.
- Under Mailer ensure that Send all WordPress emails via SMTP is selected.
- In the SMTP Options section:
- SMTP Host: Enter the Server Name provided by Amazon SES.
- SMTP Port: Enter 587 (if during testing you encounter errors then try port 25 or 465. The error EOF caught while checking if connected is a good indication that the port number needs changing.
- Encryption: Select Use TLS encryption.
- Authentication: Select Yes: Use SMTP authentication.
- Username: Enter your SES provided username.
- Password: Enter your SES provided password.
- Click Save Changes.
- Send yourself a test email.
If you don’t receive the test email then check your email spam/junk folder. If the test email isn’t there then change the port number per item 6.2 above.