Mailgun SMTP settings: smtp.mailgun.org (smtp.eu.mailgun.org), port 587

Mailgun SMTP relay: host smtp.mailgun.org (EU: smtp.eu.mailgun.org), ports 587/2525 STARTTLS or 465 SSL, SMTP username postmaster@yourdomain with a domain SMTP password. Free trial limits and error fixes.

Mailgun outgoing mail server: smtp.mailgun.org, port <code>587</code> (STARTTLS) or <code>2525</code> (STARTTLS) or <code>465</code> (SSL/TLS) or <code>25</code> (STARTTLS), username = postmaster@yourdomain.com (default SMTP user) or an SMTP credential you create for the domain, password = the SMTP password shown in Sending → Domain settings → SMTP credentials.

Mailgun SMTP settings at a glance

Outgoing (SMTP) hostsmtp.mailgun.org (US region) — smtp.eu.mailgun.org (EU region)
Ports & encryption
587 — STARTTLS <em>(recommended)</em>
2525 — STARTTLS
465 — SSL/TLS
25 — STARTTLS
Usernamepostmaster@yourdomain.com (default SMTP user) or an SMTP credential you create for the domain
Passwordthe SMTP password shown in Sending → Domain settings → SMTP credentials (not your account password)
AuthenticationEach sending domain has its own SMTP credentials; the region of the host must match where the domain was created.

How to set up Mailgun SMTP

  1. Sending → Domains → Add new domain → add the DNS records → verify.
  2. Domain settings → SMTP credentials → reset/create the postmaster password.
  3. App settings: host smtp.mailgun.org (or EU), port 587, STARTTLS, username postmaster@yourdomain.com, password = SMTP password.

Sending limits

  • Free trial: 100 emails per day for 30 days (then Foundation from around $35/month); sandbox domains only send to authorised recipients.
  • Domain must be verified with SPF/DKIM TXT records.

Things that catch people out

  • Using the US host for an EU domain fails authentication.

Common Mailgun SMTP errors

Server replyMeaningFix
535 5.7.0 Mailgun is not loving your login or passwordWrong SMTP password or wrong region host.Reset the domain's SMTP password; check region.
550 5.7.1 Relaying denied / Sandbox domainSandbox recipient not authorised.Add a verified domain.

More codes: 535 authentication failed, 550 relay denied, 554 rejected as spam, connection timed out — or all SMTP error codes.

When Mailgun is not enough for your app

When a provider caps you or blocks a port, point the same app at QueenSMTP instead: host smtp.queensmtp.com, port 587 (STARTTLS) or 465 (SSL), your SMTP username and password from the dashboard. $5/year plus $0.10 per 1,000 emails, 100 free a day to test.

Get SMTP credentials — free to test Test Mailgun now

Verified 2026-08-30 against Mailgun's documentation and live DNS. Found a change? Tell us.

Mailgun SMTP — questions

smtp.mailgun.org for US-region domains and smtp.eu.mailgun.org for EU, on port 587 (STARTTLS) or 465 (SSL), with postmaster@yourdomain and the domain SMTP password.