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

Mailrith email delivery connections page showing connected providers with action controls.
The Email Delivery Connections page lists every connected provider. From here you can add a new connection, send a test email, view webhook endpoints, and assign connections to workspaces.

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).
Mailrith email delivery connections page showing connected provider rows
After saving, use View webhooks on the Mailgun connection row to get the endpoint URL to configure in Mailgun's webhooks section.

Mailgun setup

  1. In Mailgun, navigate to Sending → Domains and confirm your domain is verified and active.
  2. Go to API Security and copy the sending key for the domain, or use an account-level API key.
  3. In Mailrith, create a new connection, select Mailgun, and enter the sending key, domain, and API region.
  4. Fill in the From name and From email, then save the connection.
  5. 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:

  1. In Mailrith, open the connection row and click View webhooks. Copy the Mailrith webhook URL.
  2. In Mailgun, navigate to Sending → Webhooks for your domain and add a new webhook.
  3. Paste the Mailrith URL and enable at minimum the Permanent Failure and Spam Complaints event types.
  4. 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.

Contact Mailrith

Related guides

On this page

Jump to the section you need.