Improve Drupal email delivery rates by using Mandrill

Recently one of my clients had a problem with a large portion of transactional email never being seen. The emails were being directed to the recipients' spam folders and were generally being over-looked. These were important emails regarding things like membership confirmations, invoices and event information and were critical to the experience of the members.

Why was this happening? Mostly because the emails were being sent by the web server. I switched it to a Mandrill, a service designed to take care of the headaches of sending transactional email, and this greatly improve the delivery rate.

It is notoriously difficult to ensure emails from your application (such as Drupal) actually get delivered without getting caught in spam filters. Email providers like Mandrill have the expertise to maximise delivery rate. You are unlikely to have the time or expertise to manage this process for your own web server.

Mandrill provides great stats so that you can gain a greater understanding of email delivery, if it is getting caught by spam filters, bounces, open rates etc. You can also test different versions of the same email to see which one performs best in terms of open rates.

Difference between Mandrill and MailChimp

It is easy to get confused between services like Mandrill and services like MailChimp. Mandrill is actually owned by MailChimp and uses the same delivery infrastructure, but the two services have very different purposes. As mentioned, Mandrill is intended for transactional email like confirmation emails, password resets, invoices sent by email. Services like MailChimp are intended to manage email lists for things like newsletters and drip email campaigns.

Setting up Mandrill

Mandrill is relatively simple to install and setup on a Drupal site.

The requirements are:

  • Mandrill module
  • Mandrill library
  • Mail System module
  • Mandrill account

After installing, go to Configuration > Web services > Mandrill.

Add your Mandrill API Key (which you need to get from your Mandrill account)

To switch email to use Mandrill, you need to configure Mail System Settings. Go to Configuration > System > Mail System. Here you will see all of the mail classes available and you can switch them to MandrillMailSystem.

MailSystem settings

In my case, with the client project, a lot of the transactional emails were a result of a customer buying a product with Ubercart. The emails were triggered using Drupal Rules.

Mandrill Test Module

While testing, you can enable the Mandrill Test module. When an email is sent, the subject will be replaced with "Altered test subject" and the body will be replaced with "Altered mail content". Just don't enable this on the production site!

Sending a test email

You can send a quick test email from Configuration > System > Services > Mandrill. You can send the test email to any email address and this will be sent via Mandrill.

Send test email via Mandrill

Mandrill pricing

Mandrill is very competitive price-wise. The first 12,000 emails are free. After that, they are $0.20 per 1000 emails. That is not per email, but per 1000 emails! So if you send 13,000 emails, the total cost is $0.20. You can send 17,000 emails for $1.

Wrapping up

Most Drupal websites will need to send some form of email. The last thing you want is to have these emails unnecessarily caught by spam folders. Fortunately this is a problem that is relatively easy to fix with a service like Mandrill and very cost efficient.

Note: I am no way affiliated with Mandrill or MailChimp!


This is a good tip, I have known of MailChimp for ages but I never new about Mandrill and 12,000 emails would be a pretty considerable site before paying a cent. There are so many systems out there it's hard to know what to use.

Thanks for this write-up, Blair.

Mandrill is an awesome service - email delivery just plain sucks sometimes and the team at MailChimp spend day in, day out on the phones to ensure that their delivery platforms are whitelisted for mail servers.

It takes the headaches away from delivering results to clients - or personally - by leveraging the Mandrill service to minimize factors out of your control. $17k emails for $1 definitely makes Mandrill a smart investment for a serious Drupal installation where the business case can't afford emails stuck in the spam folder.

Peter Macinkovic / Digital Strategy Consultant

What is the difference between using the SMTP module with Mandrill API key vs the Mandrill module ? I've tried both these modules and they both work fine. I prefer the SMTP module since it doesn't require any additional modules/libraries. Is there any reason to switch over to Mandrill Module ?

Blair Wadman's picture

I haven't used the STMP module, so can't give you a definitive answer. I'm assuming the STMP module supports more than just Mandrill? So one advantage of the Mandrill module would be that could be more streamlined because it only does Mandrill. But if SMTP works for you, probably no reason to switch to the Mandrill module.

The Mandrill module works with the Mailsystem module which allows you to choose which emails go via Mandrill, whereas the SMTP module is simply either on or off.

Also, you can use a single Mandrill account with multiple sub-accounts (e.g. if you're an agency maintaining multiple client sites). These let you keep the reputation of each client site separate within Mandrill so spam reports etc from one sub-account don't compromise the other sub-accounts. The Mandrill module allows you to specify which sub-account to use on each site.

I think there's room for both. Personally, I prefer the Mandrill module.

New comments for this tutorial have been turned off.