Mailgun Setup with Namecheap DNS for Sparkforge

By Sparkforge Support Team ·Last reviewed May 3, 2026

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

  1. Sign up at mailgun.com and verify the email address.
  2. Add a new sending domain in Mailgun under Sending > Add New Domain.
  3. Use a subdomain like mg.companyname.com when possible.
  4. Choose the US region. EU-region domains do not appear in Sparkforge.
  5. 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)

  1. Click Add New Record, choose TXT Record.
  2. Host: subdomain prefix (mg) or @ for root.
  3. Value: v=spf1 include:mailgun.org ~all
  4. Click the green check to save.

2nd TXT record (DKIM)

  1. Click Add New Record, choose TXT Record.
  2. Host: copy the host prefix from Mailgun, stripping the root domain. Example: mx._domainkey.helpdesk.
  3. Value: paste the long DKIM string from Mailgun.
  4. Save.

1st MX record

  1. Click Add New Record, choose MX Record.
  2. Host: subdomain prefix or @.
  3. Value: mxa.mailgun.org
  4. Priority: 10
  5. Save.

2nd MX record

  1. Add another MX record.
  2. Host: same as the first MX.
  3. Value: mxb.mailgun.org
  4. Priority: 10
  5. Save.

CNAME record

  1. Click Add New Record, choose CNAME Record.
  2. Host: for mg.companyname.com use email.mg; for the root domain use email.
  3. Value: mailgun.org
  4. Save.

Verify in Mailgun and send a test

  1. Go back to Mailgun and click Verify DNS Settings.
  2. Re-verify after a few minutes if any record is still red.
  3. Copy your Mailgun API key into Sparkforge.
  4. 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?