How To Ease The Load Of Sending Email From WordPress

Your WordPress site can generate a lot of email especially if you use a newsletter plugin or provide your visitors with new post notifications and this looms large as a potential problem as your traffic increases.

In this Weekend WordPress Project, we’ll find out how to address these potential problems in less than 15 minutes by outsourcing your site’s email to Mailchimp’s transactional email service, Mandrill.

WordPress Weekend Project  banner with email logo
Take a load off your WordPress hosting, outsource your email

Mailchimp is, as you probably know, an incredibly popular email marketing platform used by many WordPress site owners, including WPMU DEV.

With 5 million customers all sending out their newsletters on a regular basis, you can safely assume that Mailchimp knows a thing or two about handling email. And with Mailchimp’s transactional email service, Mandrill, you can leverage all that know-how for your own site.

Not only will you take the load of your own hosting infrastructure but you’ll also get access to statistics on all your emails (including the standard WordPress emails) and be able to leverage Mandrill’s reputation.

Best of all, Mandrill comes with a free account that allows 12,000 emails per month which should cover most sites that are in the starting out phase.

Integrating Mandrill with your WordPress site requires just 7 quick and easy steps, including the initial setting up of a Mandrill account.

Set Up A Mandrill Account

Screenshot of the Mandrill SMTP & API Credentials settings
Once you have set up an account, create an API key
  1. Go to the Mandrill website and click on Sign Up to create an account.
  2. Log in and click on the gear icon in the top right-hand corner and select SMTP and API Credentials.
  3. Click on +New API Key, fill in the description and click on Create API Key.

An new API key will be created. You’ll need this when configuring the plugin, so copy the key value.

Configuring The Plugin

Screenshot of the Mandrill settings in WordPress
Just fill in your API key, the FROM address and FROM name
  1. Download the official Mandrill plugin from the WordPress plugin repository and activate it.
  2. Go to Settings > Mandrill.
  3. In the Settings, complete API Key (use the key value you copied from your Mandrill account), FROM Name and FROM Email. Ensure that Track opens and Track clicks are checked.
  4. Complete the test email settings and send yourself a message.

How It Works

The plugin intercepts any calls made by WordPress to the built-in email handler to send emails and transfers the request to Mandrill using the API. So, effectively you replace a call to send an email with a call to Mandrill.

If your test email came through okay, all your email is now going via Mandrill and the Mailchimp infrastructure. You will initially be restricted to an hourly quota for sending email but as you prove your reputation then the quota will grow.

Of course, as a Weekend Project we are only covering the basics but Mandrill comes with plenty of advanced features such as Webhooks that will call a URL on your site when a specific event happens in a Mandrill-sent email (such as a bounce).

Pricing Beyond The Free Tier

Whilst 12,000 monthly emails is a pretty good start, it’s obviously worthwhile checking out what the costs could be if, as you probably hope, your site starts to scale up.

Here’s some indicative costs (as at time of writing):

  • 20,000 / month – $1.60 / month
  • 50,000 / month – $7.60 / month
  • 100,000 / month – $17.60 / month

For more specific pricing details go to the Mandrill pricing page.

Useful For Local Set-Ups

Whilst Mandrill can take the strain off of your production site, it’s also can solve a frequent problem for those development and test sites that are locally hosted and often don’t have email sending capability.

Simply install and configure the plugin and your local site will have the same email capability as your production site.

15 Minutes To Ease That Load

Offloading your email delivery to a dedicated service such as Mandrill is well worth the 15 minutes it takes to set up, if only because of the load it will remove from your own hosting infrastructure.

Chuck in the reputation management, the statistics, the advanced features such as webhooks and 12,000 free emails a month and it’s a virtual must-do for your WordPress site.