How to Set Up Mailgun Using Cloudflare in GoHighLevel
By Marnix Geerkens. Published 2020-03-18. Updated 2026-06-02.
Connecting Mailgun to GoHighLevel through Cloudflare takes five DNS records: two TXT records, two MX records, and one CNAME. Once all five show green checkmarks inside Mailgun's domain dashboard, you copy the API key and paste it into GoHighLevel's settings. The whole process takes about ten minutes if your DNS propagates quickly.
Watch it, then build it
Get the full platform free for 30 days
That walkthrough runs on GoHighLevel. Start it free through RocketLauncher and you get 30 days instead of the usual 14, the whole platform unlocked, plus our setup help and a community of thousands of builders in 47+ countries.
30 days, not 14Full platform, nothing held backFree community and setup help
We earn a referral commission if you keep GoHighLevel after the trial. It never changes your price.
Summary. This walkthrough covers adding a Mailgun sending domain using Cloudflare for DNS management. You create the domain in Mailgun, copy the required DNS records, add each one in Cloudflare (using only the subdomain portion in front of the root, not the full hostname), and then verify. A key detail for Cloudflare users is that the CNAME record must have the proxy toggle off, otherwise Mailgun cannot verify it. After verification, the API key from Mailgun goes directly into GoHighLevel's email settings.
What you will learn
- Which five DNS records Mailgun requires and what each one does
- How Cloudflare handles subdomain entry differently from some other registrars
- Why the CNAME record must not be proxied through Cloudflare
- Where to find the Mailgun API key and where to paste it in GoHighLevel
- How to confirm the setup succeeded with green checkmarks in Mailgun
Steps
Add your domain in Mailgun
Log into Mailgun and add a new domain. Mailgun suggests a subdomain like mg.yourdomain.com. You can choose a different prefix (for example, replies), but the mg convention is fine for most setups.
Copy the first TXT record
Mailgun shows several records to add. Start with the first TXT record. In Cloudflare, create a new TXT record and type only 'mg' in the Name field (not mg.yourdomain.com). Paste the value and save.
Add the second TXT record
The second TXT record has a longer subdomain prefix. Copy everything in front of the root domain name, paste it as the Name in Cloudflare, paste the value, and save.
Add both MX records
Add the first MX record with Name 'mg', priority 10, and the Mailgun mail server as the value. Repeat for the second MX record, which also uses priority 10 and a different Mailgun mail server address.
Add the CNAME record with proxy off
Create a CNAME record with the full subdomain prefix Mailgun specifies as the Name, and the Mailgun target as the value. Make sure the Cloudflare proxy (orange cloud) is turned off for this record. Mailgun needs a direct DNS lookup to verify it.
Verify DNS in Mailgun
Back in Mailgun, click Verify DNS. Then navigate to Domains, open Domain Settings for your domain, and check the DNS Records tab. All records should show green checkmarks. If any are still pending, wait a few minutes for propagation and verify again.
Copy the API key into GoHighLevel
In Mailgun, go to your account icon, then Security, then API Keys. Reveal the key, copy it, and paste it into the Mailgun field inside GoHighLevel's email service settings.
Tips
- If you use GoDaddy or Google Domains instead of Cloudflare, you may need to enter the full subdomain (mg.yourdomain.com) rather than just 'mg'. Try both if you hit a verification error.
- Mailgun's help documentation includes registrar-specific guides for GoDaddy and other popular providers if you get stuck on DNS formatting.
Related tutorials
Watch it, then build it
Get the full platform free for 30 days
30 days, not 14Full platform, nothing held backFree community and setup help
Frequently asked questions
Why must the Cloudflare CNAME not be proxied?
Proxying routes traffic through Cloudflare's IPs, hiding the real DNS target from Mailgun's verifier.
How long do DNS changes take to propagate?
Usually a few minutes with Cloudflare, though it can occasionally take up to an hour.
Can I use a subdomain other than mg for Mailgun?
Yes, any subdomain works. The prefix you choose becomes the sending subdomain for your domain.
Where exactly does the Mailgun API key go in GoHighLevel?
Settings > Email Service, in the Mailgun API key field for the relevant sub-account.






