Set up Mailgun
Mailgun requires a verified sending domain, a sending key, and a correctly matched API region — selecting the wrong region is the most common setup error, so confirm it before saving.
5 min read
Before you start
Before connecting Mailgun to Mailrith, have the following confirmed in your Mailgun account:
- A verified sending domain. In Mailgun, go to Sending → Domains and confirm the domain you plan to use is verified (all DNS records are green). Mailrith will send through this domain.
- Know your domain's region. Mailgun domains are hosted in either the US or EU region, and you must use the matching API endpoint. Check which region your domain is in — this is visible in the Mailgun dashboard next to the domain name.
- A sending key or API key. Mailgun offers both domain-specific sending keys and account-level API keys. A domain-specific sending key scoped to the exact sending domain is the more secure option.
Mailrith fields
When creating a Mailgun connection in Mailrith, fill in the following fields:
- Sending Key: the Mailgun API key or domain-specific sending key used for authenticated send requests.
- Sending Domain: the exact Mailgun domain Mailrith should send through — for example,
mail.acme.com. This must match a verified domain in your Mailgun account. - API Region: select US or EU to match the region where your domain is hosted. Selecting the wrong region will cause all send attempts to fail.
- From name: the display name for the sender — for example, "Acme Updates".
- From email: the email address in the From field. Must use the verified sending domain (for example,
hello@mail.acme.com).
Mailgun setup
- In Mailgun, navigate to Sending → Domains and confirm your domain is verified and active.
- Go to API Security and copy the sending key for the domain, or use an account-level API key.
- In Mailrith, create a new connection, select Mailgun, and enter the sending key, domain, and API region.
- Fill in the From name and From email, then save the connection.
- Use Send test email to confirm the domain, region, and key combination is correct before using the connection in a live campaign.
A common setup mistake is selecting the wrong API region. If the test email fails with an authentication error, double-check that the region selected in Mailrith matches where the domain is actually hosted in Mailgun.
Webhooks and region
Mailgun delivers all event types — bounces, failures, complaints — through a single webhook endpoint per domain. To configure it:
- In Mailrith, open the connection row and click View webhooks. Copy the Mailrith webhook URL.
- In Mailgun, navigate to Sending → Webhooks for your domain and add a new webhook.
- Paste the Mailrith URL and enable at minimum the Permanent Failure and Spam Complaints event types.
- Save. Mailgun will start delivering events to Mailrith for subscriber status updates.
The webhook must be configured in the correct Mailgun region. If your domain is in the EU region, configure the webhook in the EU Mailgun dashboard — not the US one. Webhooks configured in the wrong region will not fire for your domain's events.
Need help?
Reach the Mailrith team if you need help planning a workflow or troubleshooting a setup.
Related guides
Connect your email sending provider, configure sender identity, test delivery, and set up webhooks for bounce and complaint tracking.
Compose one-off email campaigns, define the audience with tags and segments, preview the result, and send immediately or schedule for later.
Build timed email series with individual delays, per-email audience filters, draft and publish controls, and step-level engagement analytics.