Documentation

✉️ Email Delivery

Documentation, reference material and tutorials for CRM-NG SMTP Email: setup guides for every mail service, troubleshooting, and one article per error message.

Mailgun

Updated

By Duane GarnerChief Executive Officer (CEO)
Summarize: Claude ChatGPT View Markdown
On this page

Connect CRM-NG SMTP to Mailgun with an API key, your verified sending domain and the matching US or EU region.

This guide shows you how to send your WordPress email through Mailgun, a developer-friendly transactional email service. It suits sites that want detailed logs and control, and businesses that need to keep data in the EU. Mailgun usually offers a free trial or a small free allowance; check its site for the current terms.

The Mailgun mailer sends through Mailgun's API. It needs three things that must agree with each other: an API key, the sending domain, and the region (US or EU) where that domain lives.

Before you start

  • A Mailgun account (sign up at https://www.mailgun.com/). Mailgun sends an activation email when you sign up; click the link in it before you go on.
  • A domain you control, with access to its DNS records. Mailgun suggests a subdomain such as mg.yourdomain.com.
  • Administrator access to your WordPress site.

Step 1: Add and verify your sending domain

  1. Sign in to Mailgun

    Go to https://app.mailgun.com/ and sign in.

  2. Open the domains list

    Open Send → Sending → Domains (the plugin's Get a Domain Name link goes there).

  3. Add a domain

    Choose Add new domain and enter it, for example mg.yourdomain.com.

  4. Pick the region

    Choose US or EU. You cannot move a domain between regions later, so pick EU if you operate under EU data rules.

  5. Publish the records

    Mailgun lists TXT records for SPF and DKIM, plus optional MX and CNAME (tracking) records. Add them at your DNS provider.

  6. Verify

    Press Verify DNS settings in Mailgun until the domain shows as verified.

The sandbox domain

Every new account gets a sandbox domain (it starts with sandbox). It only sends to recipients you add as authorised, so use it for a quick trial at most. Use your own domain for the live site.

Step 2: Create an API key

  1. Open API security

    Open the account menu (top right) and choose API Security (the direct address is https://app.mailgun.com/settings/api_security).

  2. Add a key

    In the Mailgun API Keys section, choose Add new key, give it a description such as your site name, and create it.

  3. Copy it

    Copy the key now; Mailgun shows the full key once.

Step 3: Connect in CRM-NG SMTP

  1. Choose the mailer

    In WordPress, open CRM-NG SMTP → Settings → General and set Mailer to Mailgun.

  2. Paste the key

    Paste the key into Mailgun API Key.

  3. Enter the domain

    In Domain Name, type the sending domain exactly as Mailgun lists it, for example mg.yourdomain.com. Do not add https:// or a trailing slash.

  4. Pick the region

    Under Region, choose US or EU to match the region you picked for the domain.

  5. Set the sender

    Set From Email to an address on that domain (or its parent domain) and set From Name. Tick Force From Email if other plugins change the sender.

  6. Set Return Path

    Tick Return Path so bounce messages go back to your From Email instead of being lost.

  7. Save

    Press Save Settings.

Send a test email

Open CRM-NG SMTP → Tools → Email Test, enter your address in Send To, and press Send Email. In Mailgun, Send → Reporting → Logs (or the logs page for your domain) shows the result. See Sending a test email.

The domain check on the test page looks for mailgun.org in the SPF record of the domain in Domain Name. See Adding DNS records.

Troubleshooting

A 404 almost always means one of three things: the domain is typed differently from Mailgun's list, the region is wrong, or the domain belongs to another Mailgun account.

Go to Top