Setting up Mailgun in Cloudflare

This article will walk you through the full process of setting up your Mailgun account in Cloudflare.
For information on how to setup a Mailgun account, see article “Mailgun Setup”.
If you are transferring your domain into Cloudflare from another DNS provider, please do so before continuing with this article.
Step 1: Retrieve MX and TXT records from Mailgun
Tired of Being the Admin, the Marketer, and the Closer?
You didn't start your business to spend hours building funnels, managing calendars, and chasing follow-ups inside HighLevel. What if someone else handled all of that for you?
Our HighLevel-trained virtual assistants know the platform inside and out — workflows, pipelines, social scheduling, reporting — so you can focus on closing deals and growing your business. Starting at only $164 per week.
Log into your account in Mailgun and add a domain from the top menu bar. Once your domain is added, you will see that Mailgun gives you a few MX records and TXT records to be added for your domain, for both successful email forwarding and verification of the domain.
Step 2: Add MX and TXT records into CloudFlare
Choose your site and select DNS Settings
- Add the CNAME record. Name = email, Value = mailgun.org, TTL = Automatic (these are examples, please use the actual items from your account)
- IMPORTANT: Make sure the Cloudflare cloud is gray and not orange/active => You have to click on the cloud icon to change this to DNS only
- Add the two MX records (these are examples, please use the actual items from your account)
- Name = domain.com (no www), value = mxa.mailgun.org, Priority = 10
- Name = domain.com (no www), value = mxb.mailgun.org Priority = 10
- Add the two TXT records (these are examples, please use the actual items from your account)
- Name= domain.com (no www), value = v=spf1…
- Name = smtp._domainkey, value = k=rsa…
Step 3: Add your mail routes in Mailgun
- Log into your Mailgun account and go to Routes section from the top menu. Now add as many routes as you want.
- For example, if your domain is example.com and you want the mail sent to [email protected] to be forwarded to [email protected], then that would be a route.
The Complete Operator's Playbook
Weekly strategies from top-performing agencies
Join 5,000+ operators who get weekly tutorials, templates, and strategies that are actually working right now.
Matt @ HLPT
Founder, HL Pro Tools
Matt and his team of 250+ are known for making it easy to win with GoHighLevel. They bundle tools, trainings and team time for a complete solution. You can use them for all your HighLevel needs from white label support to done-for-you fractional marketing services.
Related Articles
HighLevel Email Campaigns 101: The Complete Guide to Creating and Sending Email Campaigns
Learn how to create and send email campaigns in HighLevel. This complete guide covers campaign setup, email builder, templates, audience tar
How To Differentiate Between Basic and Custom for RSS Headers and Items in HighLevel’s Email Builder
Within HighLevel’s Email Builder, you may be using the RSS Header or RSS Item elements to automatically update information across sites. The
How to Connect SendGrid as your SMTP Service in HighLevel
If you are using SendGrid for emails, you can connect your account to HighLevel to integrate it and send emails directly through HighLevel.