Mailgun Setup with Namecheap DNS for Sparkforge
To connect Mailgun to a Namecheap domain, add SPF and DKIM TXT records, two MX records, and a CNAME under Advanced DNS, then verify in Mailgun and test from Sparkforge.
Namecheap's Advanced DNS panel makes Mailgun setup quick if you know which fields map to which record. Plan for 15 minutes plus propagation time.
Before you start
- Sign up at mailgun.com and verify the email address.
- Add a new sending domain in Mailgun under Sending > Add New Domain.
- Use a subdomain like
mg.companyname.comwhen possible. - Choose the US region. EU-region domains do not appear in Sparkforge.
- Leave the Mailgun DNS instructions open — you'll switch back and forth.
Add DNS records in Namecheap
Sign in to Namecheap, open Domain List, click Manage next to your domain, and pick Advanced DNS.
1st TXT record (SPF)
- Click Add New Record, choose TXT Record.
- Host: subdomain prefix (
mg) or@for root. - Value:
v=spf1 include:mailgun.org ~all - Click the green check to save.
2nd TXT record (DKIM)
- Click Add New Record, choose TXT Record.
- Host: copy the host prefix from Mailgun, stripping the root domain. Example:
mx._domainkey.helpdesk. - Value: paste the long DKIM string from Mailgun.
- Save.
1st MX record
- Click Add New Record, choose MX Record.
- Host: subdomain prefix or
@. - Value:
mxa.mailgun.org - Priority: 10
- Save.
2nd MX record
- Add another MX record.
- Host: same as the first MX.
- Value:
mxb.mailgun.org - Priority: 10
- Save.
CNAME record
- Click Add New Record, choose CNAME Record.
- Host: for
mg.companyname.comuseemail.mg; for the root domain useemail. - Value:
mailgun.org - Save.
Verify in Mailgun and send a test
- Go back to Mailgun and click Verify DNS Settings.
- Re-verify after a few minutes if any record is still red.
- Copy your Mailgun API key into Sparkforge.
- Send a test email from Conversations to confirm delivery.
Frequently Asked Questions
Where do I edit DNS in Namecheap?
Open Domain List, click Manage next to the domain, then select the Advanced DNS tab. All Mailgun records go there, not in the Mail Settings section.
Why does Namecheap auto-add the domain to my host field?
Namecheap appends the root domain automatically. Enter only the prefix (mg, replies, or @) and let Namecheap fill in the rest.
Should I remove Namecheap's email forwarding?
Only if Mailgun is on the root domain. For subdomain setups, leave Namecheap's existing email forwarding in place.
What's the priority value for MX records?
Both Mailgun MX records use priority 10. Equal priorities tell Namecheap to balance inbound mail across both endpoints.
Was this article helpful?
Thanks for the feedback.