Mailgun as a WordPress SMTP Server

For a typical WordPress site that needs password resets and contact form notifications to arrive reliably, Mailgun is paying for tooling you will not use. Mailgun is developer-focused email infrastructure: HTTP API and SMTP relay for transactional email, plus inbound routing, email validation, and granular event webhooks – features that matter to application developers building on email as a platform, not to most WordPress operators. Sinch acquired it in 2020.

Mailgun works with WordPress. An official plugin connects via API, WP Mail SMTP has a native Mailgun integration, and any mailer plugin can connect via SMTP. The question is not whether it works but whether it is the right fit. Mailgun has no permanent free tier and its entry pricing starts at $15/month – for that budget, Postmark or SMTP2GO are better defaults for most sites. Mailgun makes sense for high-volume deployments or when the infrastructure features (inbound routing, email validation APIs) are actually part of the application design.

SMTP settings

Setting Value
Host smtp.mailgun.org
Port 587 (TLS/STARTTLS, recommended)
Encryption TLS
Authentication Login
Username Domain-specific (found in Mailgun dashboard under your sending domain)
Password Domain-specific SMTP password (not the account API key)

Alternative ports: 465 (SSL) and 2525 (if your host blocks 587).

Mailgun uses per-domain SMTP credentials, not account-level credentials. Each sending domain has its own username and password, which you find in the Mailgun dashboard under the domain’s settings. Add Mailgun’s SPF and DKIM records to your domain’s DNS before sending production email. After configuring DNS, verify with swaks that messages authenticate correctly.

Pricing

Mailgun has no permanent free tier. A trial provides limited free emails for new accounts, but ongoing use requires a paid plan or pay-as-you-go billing.

Plan Price Volume Key inclusions
Flex (pay-as-you-go) $2/1,000 emails No minimum Basic sending only
Basic $15/mo 10,000 emails/mo Webhooks, 1 custom domain, 2 API keys
Foundation $35/mo 50,000 emails/mo Email templates, 1,000 sending domains, 5-day log retention
Scale $90/mo 100,000 emails/mo 5,000 email validations, dedicated IP, send time optimisation, 30-day logs
Enterprise Custom Custom SLA, dedicated support, custom infrastructure

Overages beyond the monthly allocation are billed pay-as-you-go: $1.80/1,000 on Basic, declining to $1.10/1,000 on Scale.

For context: a WordPress site sending 500 transactional emails per month, a fairly typical volume for a small-to-medium site with contact forms and WooCommerce, would pay $15/month on Mailgun’s Basic plan. The same volume costs nothing on Brevo’s free tier (300/day), nothing on SMTP2GO’s free tier (1,000/month, 200/day cap), or approximately $0.50/month on Amazon SES ($0.10/1,000). Mailgun’s pricing page rewards careful reading.

WordPress integration

Three paths:

Official Mailgun plugin – The Mailgun for WordPress plugin uses Mailgun’s HTTP API by default (not SMTP). Enter your API key and sending domain, and the plugin replaces wp_mail() to route all WordPress email through Mailgun’s API endpoint. API mode is generally more reliable than SMTP on hosts that restrict outbound connections, since it uses standard HTTPS rather than SMTP ports. See our list of WordPress plugins that connect to Mailgun for other compatible options.

WP Mail SMTPWP Mail SMTP includes a native Mailgun integration. Select “Mailgun” as the mailer, enter the API key and sending domain. This is the better choice if you want WP Mail SMTP’s email logging, deliverability tracking, and fallback features alongside Mailgun’s sending infrastructure.

Generic SMTP – Any mailer plugin (Post SMTP, FluentSMTP, or WP Mail SMTP in “Other SMTP” mode) can connect to smtp.mailgun.org using the credentials above. This is the lowest-common-denominator path; it works everywhere but does not use Mailgun’s API features.

When Mailgun is the right choice

Mailgun fits well in two scenarios:

Developer-led WordPress projects. If a WordPress site is part of a larger application stack where Mailgun is already the email infrastructure, handling transactional email, inbound routing, and event webhooks across multiple services, routing WordPress email through the same Mailgun account consolidates email operations. The per-domain credential model and API-first design serve this use case well.

High-volume WordPress sites. At Foundation-tier volumes (50,000+ emails/month), Mailgun’s pricing becomes competitive and the infrastructure features (dedicated IP on Scale, send time optimisation, email validation) start to matter. A large WooCommerce store or a WordPress multisite network sending at this scale is in Mailgun’s target market.

When Mailgun is not

For the typical WordPress site (a blog, a small business site, a WooCommerce store doing a few dozen orders per day), Mailgun is overpriced relative to the alternatives. The developer tooling is irrelevant, the API features go unused, and the lack of a free tier means paying from day one for a service where free and cheaper options exist.

Better fits for typical WordPress transactional email:

  • SMTP2GO – free tier (1,000/month, 200/day cap), SMTP relay, no developer tooling overhead
  • Brevo – free tier (300/day), also handles marketing email if needed
  • Postmark – transactional-only with high deliverability, $15/month for 10,000 emails
  • Amazon SES – $0.10/1,000 for sites already on AWS

Mailgun is a good email infrastructure service. Most WordPress sites will find better value elsewhere, but Mailgun earns its price at the volumes and complexity levels it targets.

For the broader setup that places Mailgun inside the WordPress email stack, see the WordPress email setup guide.


Pricing verified June 2026. SMTP settings verified against Mailgun documentation.

Mailgun as a WordPress SMTP Server detailsWebsite ↗
Pricing Url
View ↗
Docs Url
View ↗
Owner
Sinch (via Pathwire, 2020)
Founded
2010
Data Residency
us, eu
Smtp Host
smtp.mailgun.org
Smtp Ports
587, 465, 2525
Auth Methods
smtp-credentials, api-key
Api Send
Dns Setup Url
View ↗
Free Tier Notes
Trial only for new accounts; no permanent free tier
Entry Price
15
Entry Volume
10000
Pricing Notes
Flex (pay-as-you-go) $2/1K; Basic $15/10K; Foundation $35/50K; Scale $90/100K adds dedicated IP. Overages: $1.80/1K (Basic) down to $1.10/1K (Scale).
Pricing Verified
2026-06-12
Dedicated Ip
Scale plan and up
Inbound Routing
Webhooks
Email Validation
5,000 validations included on Scale; paid add-on otherwise
Template Engine
Foundation plan and up
Log Retention
5 days (Foundation), 30 days (Scale)
Capabilities Verified
2026-06-12
Official Plugin
mailgun-plugin
Works With
wp-mail-smtp, fluent-smtp, post-smtp
Wp Integration Verified
2026-06-12
Verdict
Solid infrastructure, overpriced for typical WordPress sites
Best For
developer-led WordPress projects already on Sinch infrastructure or sending 50K+ emails/month