Mailgun setup and configuration
Mailgun is powerful and reliable, but getting the details right (DNS verification, the right region, routes for incoming email, webhook signing, Cloudflare settings) decides whether it just works or quietly loses email.
The short answer
We set up Mailgun for your business or application: add and verify your sending domain (SPF, DKIM, MX and tracking records), choose the right region, configure receiving routes that forward replies to your system, set up webhooks for delivered, opened, bounced and complaint events with signature checking, and integrate sending into your website or app. Our own mail system runs on Mailgun.
What’s included
- Domain setup: a sending subdomain verified with SPF, DKIM, MX and tracking records.
- DMARC for the domain, aligned with Mailgun’s signing.
- Receiving routes: incoming email forwarded to your application or mailbox.
- Webhooks for delivered, opened, clicked, bounced, complained and unsubscribed events, with signature verification.
- Integration with your website, PHP application or CRM, through the API or SMTP.
- Cloudflare and firewall settings so Mailgun’s webhooks and forwarded email aren’t blocked.
How we do it
- Plan domains, regions and what should happen to replies.
- Configure Mailgun and publish the DNS records.
- Set up routes and signed webhooks.
- Integrate and test end to end: send, reply, bounce and complaint.
- Document the setup and keys.
The details that catch people out
- Mailgun’s DNS records added with Cloudflare’s proxy switched on, so verification fails.
- Webhook URLs that redirect (for example, the non-www address to www), which Mailgun doesn’t follow.
- Cloudflare’s bot protection blocking Mailgun’s webhook calls.
- Webhooks accepted without checking the signing key, which lets anyone fake them.
- A US-region account configured with EU-region API addresses, or the reverse.
We run it ourselves
ZeroSpams’ support inbox and email marketing send and receive through Mailgun, with routes, signed webhooks and delivery tracking. We set yours up the same way.
Common questions
Can you connect Mailgun to our own application?
Yes, through the API or SMTP, including receiving replies and handling delivery events.
Do we need a subdomain for Mailgun?
It’s recommended: a subdomain such as mg.yourcompany.com keeps Mailgun’s sending separate from your everyday email.
Do you work with other sending services?
Yes: the same principles apply to other providers, and we’ll recommend what fits.