How to solve email delivery problems with WP Mandrill

Updated on

On 24 February, 2016, Mandrill announced major changes to its API that will require all users to have paid accounts with MailChimp. I love MailChimp, but this requirement will significantly increase the costs for small restaurants.

I now recommend using Postmark and wrote a short introduction to getting started with Postmark.

The original article

We’ve all faced the same problem. An email was sent. You’re sure it was sent. But the recipient says they didn’t get it. Why does this happen? How can you prevent it?

In this post I’ll tell you why email delivery often runs into problems and describe how you can use a third-party sender to get around common problems with your web server.

Let’s focus on your mail server

There’s two kinds of problems you can face. One is that you’ve written an email in your own email account, like you@gmail.com or my-business@hotmail.com. The other is when your web server is supposed to send an email — for instance, when WordPress sends an email to a newly created user.

I’m going to focus on the second problem because it is very common for many of you running small WordPress sites for your restaurants. If you’re using my Restaurant Reservations plugin, you need to make sure your customers receive their booking notification emails. Too often, they don’t land in your customers’ inboxes, though. The same is true for many of the contact form plugins you’re likely to be using. Here are a few reasons why.

Woops, bad email address!

This one’s obvious, but it’s also the most common. Visitors will often supply a bad email address. In this case, there’s really nothing you can do.

It’s also possible that you supplied a bad email address. Most plugins that send email will let you set where the email is coming from. This is put into what we call an email’s HEADER. A badly formed FROM header could be causing your mail server — or their mail client — to choke on the email.

Make sure you’ve used a real, correctly-formatted email address.

Your email server says no

Sometimes an email will seem to be perfectly formatted, but it will never get sent. What gives? It’s possible that your web host has set specific limitations on what kinds of email they’re willing to send.

Many hosts will only send email from an email address that is registered with the server. They may not want to send that email that you’ve said is from you@gmail.com. They may require the email be sent from an email address on the same server hosting your-website.com, like you@your-website.com.

How can you find out? The best thing to do is record the date and time of an email that ought to have been sent, but never arrived. Supply that information to your web host and ask them what gives. They should be able to check their logs and see if any errors were reported for that email.

Their email server says no

Even if you’ve created a perfect email and your server is sending it out, the recipient’s email server might reject it. The most common cause of this is a spam filter. When the recipient’s email server gets the message, they determine it looks like spam and drop it before even passing it onto your recipient’s junk mail folder.

This happens a lot to email sent on shared web servers — probably the type of web hosting you are using yourself. That’s because there are a lot of different customers sharing a single email server. All it takes is one bad actor on that server to cause the whole thing to be blacklisted.

It’s a tricky problem, but if you approach your web host with delivery problems, they ought to help you move to another server or provide a solution of some kind.

Their email client says no

Sitting on top of all of this server structure is the email client. What’s that? Think of Outlook, if you use that. Or Gmail itself if you use them. Email clients often implement their own filters which can prevent items from reaching the inbox.

This one’s tricky, because it’s very hard to find out why your email didn’t make it to the inbox. There’s not a single approach you can take to solve this problem.

Make your life easy: use a third-party mail sender

A few people will have the resources and expertise to sort out all of their problems and run a highly proficient mail server. But to be honest it’s a really tricky game. The rules are always changing.

That’s why I recommend small-scale websites use a third-party mail sender like Mandrill. They send billions of emails every month and maintain close working relationships with the largest email providers (think Gmail, Outlook, etc). They have some of the smartest people in the world closely monitoring their mail delivery rates to ensure they remain consistent.

Mandrill used to be free under a certain monthly volume. But it looks like now they only offer up to 2,000 emails free. After that, you’ve got to pay $9.95 per month for 25,000 emails per month. That’s more than enough for pretty much any restaurant website.

Lucky for us, they provide a WordPress plugin, wpMandrill, that makes the configuration very easy. You just sign up at Mandrill.com and then put your API key into the plugin on your WordPress site.

I’ve been using it for about a year here at Theme of the Crop and it’s been very successful. I rarely get complaints from customers that they haven’t received their purchase receipt. And I am no longer missing occasional contact form submissions.

Of course, I do still get reports of email not received now and then. There’s no silver bullet to email delivery, and even top-of-the-line providers can’t reach 100% delivery rates.

But it’s a massive improvement. So do yourself a favour and give it a shot. Your customers will appreciate it.