Back to main menu


Migrating from the Heroku Mandrill add-on to the Mailgun add-on

After the Mandrill add-on was depreciated in 2016, Mailgun made sure that anyone migrating from the Mandrill add-on would have a smooth transition to the Mailgun add-on.



This post was originally published on February 29, 2016.

With Mandrill announcing that the Heroku add-on is no longer going to be available after April 25th, many developers are looking for an alternative solution that they can continue using from the Heroku Marketplace.

Mailgun offers several different packaged add-ons that you can select from based on the volume of e-mail you send on a monthly basis. You can upgrade to a larger plan at any time or if you need something specific to your needs, a program can be custom tailored for you.

Install the Mailgun Add-on

The free starter plan can be easily installed on your application by running the following Heroku CLI command from your application’s folder:

heroku addons:create mailgun:starter

The starter plan includes 400 messages per day and is perfect to get started with.

Setting up Mailgun

You can open the Mailgun dashboard by running the following command:

heroku addons:open mailgun

When Mailgun is provisioned, a sandbox domain is automatically configured that can be used for testing Mailgun without setting up a custom domain. The sandbox domain is limited to 300 messages a day and is not optimized for deliverability.

For production use, setting up a custom domain is the best option. In the Mailgun dashboard, click the Add Custom Domain button.

Update DNS

After setting up your domain, you’ll be given a set of DNS records that need to be added to your DNS provider before your domain can be used. Setting up these records enable SPF, DKIM, incoming messages, and message tracking.

Once the records are in place, you can wait for automatic validation to occur or click the Check DNS Records Now button to force an immediate check.

Button for "Check DNS Records Now" on Mailgun dashboard

Updating Your Applications

At this point, you’re ready to update your application to use the Mailgun addon. If you’re using a library that uses SMTP, you can update your application’s configuration to the following:

If you’re using a Mandrill library, you will need to migrate to a Mailgun-specific library or a library that is SMTP compatible. We have code samples for most major languages.

Need Help?

Our team is available 24/7/365 to help make sure you have a successful transition to Mailgun. From the Mailgun dashboard, click the Support button to access our help center or create a support ticket.

Related readings

An expanded Mailgun product suite to transform email deliverability

Today marks a special day for Sinch Mailgun. For over a decade, our focus has been to provide the best email experience for businesses all around the world. Now, we take...

Read more

Forrester TEI study reveals Sinch Mailgun ROI and outcomes

When an enterprise starts working with Sinch Mailgun, what’s the financial impact that choice has on the business? It’s a good question – but not exactly an easy one to answer...

Read more

Privacy, automatic engagements, and Mailgun’s bot detection

Now more than ever, users are concerned about their data privacy and what steps they can take to protect their personal information. And that’s something big players in the tech...

Read more

Popular posts

Email inbox.

Build Laravel 10 email authentication with Mailgun and Digital Ocean

When it was first released, Laravel version 5.7 added a new capability to verify user’s emails. If you’ve ever run php artisan make:auth within a Laravel app you’ll know the...

Read more

Mailgun statistics.

Sending email using the Mailgun PHP API

It’s been a while since the Mailgun PHP SDK came around, and we’ve seen lots of changes: new functionalities, new integrations built on top, new API endpoints…yet the core of PHP...

Read more

Statistics on deliverability.

Here’s everything you need to know about DNS blocklists

The word “blocklist” can almost seem like something out of a movie – a little dramatic, silly, and a little unreal. Unfortunately, in the real world, blocklists are definitely something you...

Read more

See what you can accomplish with the world's best email delivery platform. It's easy to get started.Let's get sending
CTA icon