Mailgun for WordPress

Connect Mailgun to WordPress with WP Mail SMTP

Send WordPress email through your Mailgun account with full webhook support, US and EU regions, and domain verification handled inside the plugin.

  • Mailgun API key authentication
  • US and EU region support
  • Webhooks for detailed email logs
  • Return-path bounce tracking
Mailgun logo with the text 'Email Automation' on a white rounded square against a green background with decorative shapes

Mailgun, set up properly for WordPress

WP Mail SMTP handles your Mailgun API key, region, domain, and webhooks, all from the WordPress admin.

API key authentication

Paste your Mailgun API key into the plugin and you’re connected. We recommend the account-level API key over a sending key, so all your domains work and webhooks stay functional.

US and EU regions

Pick the region that matches your Mailgun setup. EU for European hosting, US for everywhere else. The plugin sends through the correct endpoint automatically.

Domain verification

Add a Mailgun subdomain like mg.example.com, drop the TXT and MX records into your DNS, and you’re verified. Full step-by-step DNS docs included.

Webhook integration

Mailgun webhooks feed real delivery data back into the WP Mail SMTP email log, so you can see bounces, opens, and clicks alongside your sent messages.

Return-path bounce handling

Set the return-path to match your From Email so bounce notifications come back to an address you actually check.

Backup connection failover

Pair Mailgun with a second mailer that takes over automatically if Mailgun fails. Critical email keeps arriving without manual intervention.

Free in Lite

The Mailgun integration is available in the free version of WP Mail SMTP. Upgrade to Pro for backup connections, smart routing, and detailed email logs.

davehultin

Verified Customer

I maintain my wife’s WordPress website and after switching to a different host she started to experience email deliverability issues with emails generated by the website’s plugin. This plugin solved those issues and we can return to living happily ever after!

The reliable way to connect Mailgun to WordPress

Get WP Mail SMTP and route your WordPress email through Mailgun in minutes.

Mailgun FAQs

Questions about running Mailgun through WP Mail SMTP. If you need more help, please contact us.

Should I use a Mailgun API key or a Sending API key?

The Mailgun API key. A sending key only works for a single domain and doesn’t support webhooks, which means you lose detailed delivery data in the WP Mail SMTP email log. The Mailgun API key works across all your domains.

Do I need to use a subdomain with Mailgun?

We recommend it. Setting up Mailgun on a subdomain like mg.example.com keeps your main domain’s DNS clean and avoids conflicts with other mail services you might be using.

Should I pick the US or EU region?

Match what you set up in your Mailgun account. If your site is hosted in the European Union, choose EU. Otherwise, leave the default US option. The plugin region needs to match the Mailgun region or sending will fail.

Why are my emails showing ‘on behalf of’ in the sender info?

Some email clients show this when the domain in your Sender field (your Mailgun subdomain) doesn’t match the From field (your main domain). To prevent it, set your From Email to use your Mailgun subdomain in the plugin settings.

Built for sites where email actually matters

Email logs, automatic failover, and smart routing all work alongside your Mailgun setup. Track, debug, and protect your sender reputation from one place in WordPress.

Illustration of email log

Email log

Keep a full record of every email your WordPress site sends through Mailgun.

  • Inspect full message content, headers, and attachments.
  • Track delivery, opens, and clicks with Mailgun webhooks.
  • Resend failed emails without leaving WordPress.
Illustration of backup connection

Backup connection

Keep critical emails sending even if Mailgun has a bad day.

  • Set a second mailer as automatic failover for Mailgun.
  • Password resets and order confirmations keep arriving during outages.
  • No code or manual intervention required.
Illustration of smart routing

Smart routing

Send different types of email through different mailers.

  • Route by sender, recipient, or email type.
  • Separate transactional from marketing email.
  • Protect your Mailgun sender reputation.