Mailgun SMTP Settings

Server smtp.mailgun.org, port 587 with STARTTLS. Full configuration, authentication requirements and fixes for the errors Mailgun actually returns.

Test these settings now

Mailgun issues SMTP credentials per sending domain. EU-region domains must use smtp.eu.mailgun.org instead of the default US host.

Mailgun SMTP server settings

Outgoing mail (SMTP)

SMTP server
Port
STARTTLS · Recommended SSL/TLS · Implicit TLS STARTTLS · Fallback
Encryption
STARTTLS
Authentication
Per-domain SMTP credentials
Username
[email protected] (from the Mailgun domain page)
Password
The SMTP password shown for that domain
Sending limit
Plan dependent

How to set up Mailgun SMTP

  1. Open Sending → Domains and select your domain.
  2. Copy the SMTP hostname, login and password from the SMTP credentials panel.
  3. Use port 587 with STARTTLS.
  4. EU domains must use smtp.eu.mailgun.org.

Verify it before you deploy. Paste these settings into the free SMTP test tool and send yourself a test message. It takes about twenty seconds and tells you whether Mailgun accepted the connection, the encryption and the login — before your application depends on it.

Common Mailgun SMTP errors

ErrorWhat to do
Authentication fails on an EU domain Switch the host to smtp.eu.mailgun.org.
Sandbox domain rejects recipients Sandbox domains only deliver to authorised recipients you add in the dashboard.

Seeing a reply code that isn't listed here? Every standard SMTP response is explained in our SMTP error code reference.

Mailgun SMTP — frequently asked questions

The Mailgun SMTP server is smtp.mailgun.org. Connect on port 587 using STARTTLS encryption.

Port 587 with STARTTLS (Recommended). Port 465 with SSL/TLS (Implicit TLS). Port 2525 with STARTTLS (Fallback).

Username: [email protected] (from the Mailgun domain page)
Password: The SMTP password shown for that domain

Switch the host to smtp.eu.mailgun.org.

Sandbox domains only deliver to authorised recipients you add in the dashboard.