Provider guide · Mailgun

Send WordPress email through Mailgun.

Mailgun's credentials belong to a domain, not to your account, and its servers come in two regions. Both facts are invisible in the signup flow and both produce authentication errors that look like a wrong password. Here is the map.

Settings · Custom SMTP Mailgun preset
  • PresetMailgun
  • SMTP hostsmtp.mailgun.org
  • Port587
  • EncryptionTLS
  • Usernamean SMTP login on your domain, like postmaster@yourdomain.com
  • Passwordthe SMTP password set for that login

Official Mailgun SMTP documentation

1 · Credentials

The Mailgun setup:
domain, DNS, credentials.

Your Mailgun sign-in email and password authenticate you, the human. WordPress authenticates as a domain, with credentials managed under that domain.

A brand-new account only has a sandbox domain, sandbox….mailgun.org, which sends to a handful of addresses you authorise and to nothing else. Real sending starts with your own domain, a paid-plan feature:

STEP 01

Add your domain

Under Sending, Domains, choose Add new domain. Mailgun’s own recommendation is a subdomain such as mail.yourdomain.com, which leaves the DNS of your root domain untouched.

STEP 02

Publish the DNS records

Mailgun hands you two TXT records for that subdomain, SPF and DKIM. Add them at your DNS provider, click Verify DNS settings, and Mailgun emails you once verification passes.

STEP 03

Open SMTP credentials

In Domain settings, pick the domain, then the SMTP credentials tab. The default login has the form postmaster@yourdomain.com.

STEP 04

Set the password and copy it

The credentials tab lets you set or reset it; do so and copy the result, because an existing password cannot be read back later, only reset.

2 · In the plugin

The Mailgun settings:
check the region.

Selecting the Mailgun preset fills the port (587), the encryption (TLS) and the US host. If your domain lives in Mailgun’s EU region, that host is wrong for you.

FIELD 01

SMTP host

smtp.mailgun.org for a US-region domain, smtp.eu.mailgun.org for an EU-region one. The region was chosen when the domain was added, and it is shown in the domain list.

FIELD 02

Username

The SMTP login from the credentials tab, postmaster@yourdomain.com unless you created another.

FIELD 03

Password

The password you set for that login.

FIELD 04

From email

An address on the sending domain, so the DNS you configured vouches for it.

Save, then use Send Test Email. On a sandbox domain, send it to an address you authorised first, or Mailgun will decline it by design.

3 · Pitfalls

Mailgun errors
and pitfalls.

Two of these three produce the same symptom, a refused sign-in, which is why Mailgun problems get misdiagnosed as password typos.

The EU trap: right password, wrong continent

Credentials belong to a domain, and the domain belongs to a region. A domain created in the EU region authenticates only against smtp.eu.mailgun.org; the preset’s US host will refuse it every time, with an error indistinguishable from a bad password. If authentication fails and you are in Europe, check the region before anything else.

The sandbox writes to five people, ever

The sandbox domain that comes with a new account sends only to addresses you explicitly authorise, five at most, each of which has to accept an invitation first. It exists to prove your integration works. Real traffic, to customers who never signed up for anything, requires your own verified domain, and custom domains are a paid-plan feature.

Your account login is not the SMTP login

Signing in to the dashboard with your email does not make that email an SMTP username. If the username field holds your account email instead of postmaster@yourdomain.com, or the password field holds your dashboard password, Mailgun refuses the connection. Both values come from the SMTP credentials tab of the domain, nowhere else.