Setup Mailgun with Digital Ocean

One really nice thing is that not having an email server to manage yourself, wanna thank Mailgun for such amazing service.

Few days ago I was trying to set up Mailgun with Digital Ocean , So I planned to write a blog post to share with other developers in the community.

Configure Your Domain

Things are a bit easire if you are setting up against your domain directly.

I would like to show my preview of how to get things configured on Mailgun end.

Here’s what you need to change your specific configuration part.

  • A record for @ should be your droplets’ IP (not mailgun’s)
  • TXT record for mg should be wrapped in quotes
  • TXT record for should be wrapped in quotes

After all under Domain Verification & DNS click on Check DNS Record Now, then if your configuration is good then you shoudl see the screen below.

Below is the Zone file how it looks like, in order to confirm for sending and receiving emails using Mailgun.

Please be sure that is the IP address of your droplet provided by Digital Ocean not provided by mailgun.


Thanks for reading this article up to the end. If you have any feedback or the article was really useful to you please leave your comments below. Feel free to share with friends if you like it.