How to Setup Mandrill (Mailgun) and MailPoet to Send Free Newsletters
MailPoet is hands down the best Newsletter plugin for WordPress right now. However, in order to use its full potential it needs to be used along with a professional SMTP service provider, like Mandrill. This tutorial will explain you how to setup Mandrill and MailPoet to send your Newsletters in style. And the best of it all: It won’t cost you a single cent!
Important Update (Mar 4, 2016): Mandrill decided to shut down their free service :( Fortunately there is another service called Mailgun.com that easily takes its place. The setup is pretty much the same as explained below. Feel free to ask questions in the comments if you get stuck and Happy E-Mail Blasting!
Mandrill and Mailpoet Setup
What you need to get started is a fully setup WordPress page and the plugin MailPoet installed and running. The process is pretty much straight forward but if you have trouble with it check out the video below:
MailPoet, a Newsletter Plugin for WordPress
1 min. demo of how creating and sending newsletters from within WordPress can be easy thanks to our visual editor. http://www.mailpoet.com
The next step is to head over to Mandrill and create an account. Mandrill is from the same guys who run the overly successful newsletter tool MailChimp and the SMTP service is free to use, for up to 12.000 E-Mails per month!
Once you have signed up to the service, head over to the SMTP & Api Credentials page. There, click on “+ New Api Key” and a new Api key will pop up below.
Now head over to MailPoet, specifically the Settings -> Send With… tab and choose “Third party” at the top. There enter the details you just got from Mandrill:
- SMTP Hostname: smtp.mandrillapp.com
- Login: Your SMTP Username from Mandrill
- Password: Your generated Api key from Mandrill
- SMTP Port: 587
- Secure Connection: TLS
- Authentication: Yes
After all settings are made, click “Save”.
Now press the “Send a test mail” button. If you receive a test mail from MailPoet everything is good and you are done. If not, double check if your settings are all correct.
SPF Settings to Secure your Domain
If you successfully sent a test mail before, this step is optional. However, you can make your system more secure by applying SPF settings to the domain. Also, if the test e-mail could not be sent, it is most likely because of the missing SPF settings. Some providers have SPF enabled and this might prevent Mandrill from sending the newsletter. Basically, SPF is an E-Mail validation system, that prevents spammers and hackers from using your e-mail address to send spam mails. Sounds like a got idea to use it, doesn’t it? Now, let’s fix this:
Head over to the “Sending Domains” setting in Mandrill. You will notice that the page will state “SPF missing”. In order to fix this you will be required to add a DNS record to your domains DNS server.
Therefore, you will need to login to your web host domain backend (the website, where you host your domain, that is used to your newsletter e-mails with) and find the DNS settings, aka the DNS Zone File. Usually, the DNS Zone File is just a text field, that looks somewhat like this:
In order to add the SPF record to it, you need to add the following line at the end of the file:
@ IN TXT “v=spf1 mx include:spf.mandrillapp.com ?all”
So, what does this do? The command will tell the DNS server, that it is ok to send e-mails in your name from Mandrill. It also allows your regular mailserver to send e-mails with this domain name. If you played around with Mandrill a bit, you will notice that they suggest to add a slightly different command to the DNS zone file. There command is missing the “mx” in the middle. What the added “mx” does is, it allows to send not only e-mails from Mandrill, but also E-Mails with your regular mailserver. This is important as you most likely send your Newsletter from a domain, that you also use for normal e-mails from your desktop. The “mx” ensures that this will still be possible.
After adding the command to the Zone File click “Save” and head back to the Mandrill “Sending Domains” page. It might take about 30 minutes, or even an hour, but then, when clicking “Test DNS settings” it should say “SPF valid”.
Congrats, you just setup Mandrill and MailPoet and on the way, made your Website digital life more secure. You are now able to send professional E-mail newsletters, using the leading service on the internet. And it didn’t cost you a dime!
Having trouble to set this up yourself? Get in touch with me and let me help. I also offer great support in Social Media Marketing and WordPress!
Excellent tutorial… thanks a million…
No problem, glad it helped!
wont work on shared hosting
Yes, it’s only for selfhosted WordPress.org sites. Not WordPress.com
Nice work, very informative. One question – what happens if you go over the Mandrill quota. We are a non-profit and send out to subscribers – more like 12,000 + per day. Can I still use Mailpoet and Mandrill combo?
Hi,
Both Mandrill and Mailpoet now charge for their services once the free quota is exceeded. Please find Mandill’s pricelist here: http://mandrill.com/pricing/
If you have more than 7000 subscrbers you’ll need also a premium version of Mailpoet:
http://www.mailpoet.com/premium/
That page you link to says that Mailpoet charges for more than 2000 subscribers, not 7000.
When you say it won’t work on share hosting…I have a wordpress hosting package through NetworkSolutions and I’m danged if I can get mailpoet to see Mandrill…. yet Mandrill works with the rest of the site…
Any ideas? Mandrill records I have valid DKIM and SPF settings for the relevant domains…but MailPoet error message begins:
Error Sending Message SMTP works with MailPoet to ian@investigatemagazine.com | SMTP Error: Could not connect to SMTP host. |
Warning: fsockopen() [function.fsockopen]: unable to connect to smtp.mandrillapp.com:587 (Connection timed out) in /data/20/1/2/11/1980174/user/2163170/htdocs/Investigate/wp-content/plugins/wysija-newsletters/inc/phpmailer/class.smtp.php on line 123
It seems that the SMTP credentials are set wrong.
Please check the following:
SMTP Hostname: smtp.mandrillapp.com
Login: Your SMTP Username from Mandrill
Password: Your generated Api key from Mandrill
SMTP Port: 587
Secure Connection: TLS
Authentication: Yes
I guess this will solve the problem!
Best,
Daniel
For some reason, this does not work with Bluehost. I get: SMTP Error: Could not connect to SMTP host. I was successful with ElasticEmail, but not with Mandrill.
It looks like this does not work with shared hosting plans from Bluehost or other providers except ElasticEmail and SendGrid. It will work for ElasticEmail and SendGrid because Mailpoet/Wysija “detects the SMTP connections to both, and uses the API behind the scenes” (https://wysija.uservoice.com/forums/150107-feature-request/suggestions/2914815-ability-to-send-with-api-mailchimp-sts-amazon-se)
Hi Daniel,
I am using blue host as my hosting provider. Even with a correct set of credentials I am also having the same problem. I am getting the same report. Could not connect to SMTP host. On the other hand I tried with almost each possible combinations. I also received another report as “unable to connect to ssl://smtp.mandrillapp.com:465 (Connection timed out)”
what is the possible solution??
Here is an answer straight from Mailpoet’s customer service:
“If your site only works with PHP Mail and ElasticEmail, it means your SMTP ports are blocked.
Let me explain it: MailPoet has support for ElasticMail API (and Sendgrid API as well), which can send messages even if the SMTP ports are blocked on your server. I know Bluehost told you the ports are open but, believe me, they are not. I understand know annoying that must be, but you have only 2 options here: (1) Send through ElasticEmail or Sendgrid (because we support their API), or (2) Ask Bluehost to unblock your SMTP ports for real.”
I decided to use MyMail (available on CodeCanyon), which works with Amazon SES using DKIM authentication. Amazon SES has the same price as Mandrill. As a bonus, you get DKIM authentication, which is not available for the free version of Mailpoet.
Hi Marin,
Thank you so much for such a responsible reply. Well by this time I already have finally managed send test mail through Sendsendgrid web API. I don’t mind as long as I can reach my followers inbox. This is a non-profit site sending only 20-30 mail per month with a frequency of 5 mails/hour at max.
Hence I am a developer I would still love to know the difference between using SMTP port, Sendgrid and Elastic mail.
Cheers!
Thanks for the info. I’m trying to setup MailPoet with Mandrill with Siteground as my host and am having this same error. I might just have to go with Amazon SES. Does anyone have a good setup tutorial for that?
I have configured this way:
SMTP Port: 465
Secure Connection: SSL
Authentication: Yes
and this works.
Same here. Did you manage to get this working?
Thank’s for the information. It looks like Mandrill is a service to send transactional emails. Is ok for newsletters too?
Absolutely. They have a limit of the amounts you can send tho. Please check their pricing page for details!
Best,
Daniel
Thanks for the great info and congratz on a beautiful website.
I just set the Mandrill+MailPoet up and I’m very pleased :) The only catch was to figure out to change the security in MailPoet from SSL to TLS and then everything worked as it should. (At least for now). Got a question though and perhaps someone here knows the answer.
In the MailPoet “Settings – Send With…” page it says towards the bottom:
“Send…
Your web host has limits. We suggest 70 emails per hour to be safe.”
I know the Mandrill has a limit of 250 e-mails an hour but do I also need to take my host/websites limit into consideration? Any ideas or hints are welcome.
Thanks :)
You can leave the Send setting at 200 e-mails per hour to be safe. Mandrill supports up to 250 e-mails per hour for the free account tho. No need to take your host into consideration :)
Thanks Daniel
excellent tutorial,
Gregory
http://www.frankensteinrec.com/
This is a great post Daniel, even still holds true for 2014.
Unfortunately I am coming up against the same issues many commenters experience: my shared host (Bluehost) blocks outgoing ports leaving MailPoet unable to connect with the Mandrill SMTP server.
What’s curious to me is that Subscribe2 with the wpMandrill plugin works flawlessly. My understanding is that wpMandrill “intercepts” the Subscribe2 mail functions and uses its own instead.
Is it possible to configure wpMandrill (or MailPoet) to perform the same interception of MailPoet’s email functions?
Would love to know if anyone out there has experience doing this whilst I’m digging through the code of all three plugins myself.
Thanks again for the great post.
I came up with a workaround for those who commented about issues with SMTP (or all) ports being blocked. It only requires the addition of the wpMandrill plugin and a quick snippet.
Check it out: http://cfxdesign.com/email-wordpress-posts-to-subscribers-with-mandrill-and-mailpoet/
Enjoy!
Cool thanks! I think now I get what all those other comments meant! Not just user error after all :)
Great overview, mate, thanks for sharing this. I was directed here by the MailPoet guys themselves – I currently use Elastic Email with MailPoet, but they let me down majorly this weekend, and the support has been less than stellar, so been looking for an alternative. Look forward to checking Mandrill out. :)
Thanks, this has been extremely helpful.
thanks, glad it helped. It’s a bit outdated these days I believe, but still gets the point accross!
For those getting a SMTP authorization failed message using Mandrill on WHM/CPanel and ConfigServer Firewall (CSF), you’ll have to allow ports 587 and 2525 in TCP_OUT. See http://stackoverflow.com/a/27229957/1178501 for more info.
Thanks for the help! I was trying to do this without help and was utterly failing. lol
Hello Daniel
Thanks for the great article. I would like to ask your opinion. I have over 1,5mil people I would like to send an email to, I use hostgator for hosting the site and would like to use the setup in your article. Do you thing mandrill and mailpoet could handle the size? Also, if I use mandrill can I increase the number of emails sent? Because this way it would take forever. Thanks and all the best
Hi Tom,Sorry I never got back to you on this one. Mandrill can surely handle these amounts of e-mail, no problem. The hosting is not an issue, unless you link back to your site in the E-Mail. With that many readers potentially visiting your website, hostgators server might shut you down due to too much traffic :-/
Great guide, worked great as outlined. Thanks :)
Thanks! It’s a bit outdated. Glad it’s still helpful!
Hi Daniel
Thank you so much for this helpful article!
Because of my small list, I found a solution which is practically free of charge.
I still have one question and don’t know if you have this experience with mandrill.
It is easy to to generate a newsletter-overview of few posts- in mailpoet, dragging these several post names into it.
This way the letter gets pailpoet’s tracking code after the URL and mantrill’s tracking code before the url of the respective posts.
Mandrill recognizes and counts opens and overal number of clicks for the letter, but deeper analytics – which link was clicked – is not tracked separately.
I noticed mandrill’s tracking code is unique for the whole newsletter, but not for the separate links inside.
Do you have any idea how to setup mandrill to count the links in the letter separately?
Any suggestion will help …
With best regards
sorry mate, dont know how to do it :-/ maybe someone else?
Hi team ,
Where can i add Subscription forms that collect emails & integrate in mandrill list
I use Mailpoet for this! Just add it as a widget!
Hello, I cannot seem to get Mailpoet to work with my Mandrill. I already have Mandrill set up and it works fine with my website contact form, so I’d like to use it for Mailpoet newsletters. I’ve set up the “sendwith” settings like you recommended, using my log-in and API key generated from Mandrill, but still no luck. I’ve got the cron setting turned on and I selected the option that I will set up my own.
My hosting is with one.com. I don’t know where to turn to get this working and don’t necessarily want to modify any MX records, as I use Yahoo for email delivery and messing with their MX records causes a ton of issues.
What do you recommend to get Mandrill set up properly to send my Mailpoet newsletters?
I’m back because Mandrill pulled the plug. It was a short relationship – but a good one! So I’m thinking MailGUN may be the best replacement for us.
Would you consider updating this post or pointing to a new post with all the info necessary to get Mailpoet and Mailgun to work?