Connecting Mailgun to a WordPress site often requires more than installing or enabling a plugin. Before Mailgun can reliably send email for a custom domain or subdomain, the sending domain must be verified through DNS.
In this case, an existing Mailgun connection had been disabled after the previous account reached its monthly email allotment. A new Mailgun account was purchased, the WordPress plugin was already installed, and the remaining work was to connect the new account by adding the DNS records Mailgun supplied.
Issue background
The WordPress site had previously used Mailgun for transactional email. That connection was disabled after unusually high email volume consumed the available monthly sending allotment.
The site owner then created a separate Mailgun account and needed help connecting it to WordPress. The plugin itself was already present on the site but disabled. Mailgun supplied DNS verification instructions for a sending subdomain, including SPF, DKIM, MX, CNAME, and DMARC records.
The main complication was that it was not immediately clear where the domain’s DNS was managed. Before any Mailgun verification could be completed, the team first needed access to the authoritative DNS provider.
Diagnosis
The request was not primarily a WordPress plugin problem. The missing piece was domain verification at the DNS level.
Mailgun had provided the following record types:
- TXT record for SPF to authorize Mailgun as a permitted sender.
- TXT record for DKIM to publish Mailgun’s cryptographic signing key.
- MX records pointing to
mxa.mailgun.organdmxb.mailgun.org. - CNAME record used for Mailgun email tracking.
- TXT record for DMARC to publish the domain’s email authentication policy and reporting configuration.
The exact hostnames, DKIM key, and DMARC reporting addresses are unique to each Mailgun account and domain. Those values should always be copied directly from the Mailgun dashboard or verification email rather than reused from another site.
Resolution steps
A repeatable process for connecting Mailgun to a WordPress site is:
- Confirm the Mailgun sending domain or subdomain. In Mailgun, identify the domain being configured for WordPress email.
- Locate the authoritative DNS provider. DNS may be managed by the domain registrar, hosting provider, Cloudflare, or another DNS service. Changes must be made wherever the active nameservers point.
- Add the SPF TXT record. Mailgun commonly provides an SPF value that includes
mailgun.org. Use the exact hostname and value shown in the Mailgun account. - Add the DKIM TXT record. Copy the selector hostname and full public key exactly as provided. DKIM values are account- and domain-specific.
- Add the Mailgun MX records if required. The documented setup used
mxa.mailgun.organdmxb.mailgun.org, each with priority 10. - Add the tracking CNAME. Mailgun supplies a hostname for email tracking that points to
mailgun.org. - Add the DMARC TXT record. Use the policy and reporting values supplied for the domain. Do not copy another site’s DMARC reporting addresses.
- Allow DNS changes to propagate. Verification may not be immediate, depending on the DNS provider and record TTLs.
- Verify the domain in Mailgun. Return to Mailgun and run the domain verification check once the records are visible publicly.
- Reconnect the WordPress integration. After the sending domain is verified, enable or configure the site’s Mailgun integration using the new account credentials and settings.
- Send a test email. Confirm that WordPress transactional messages are successfully reaching the intended inbox and that Mailgun reports the message as accepted or delivered.
Because DNS values vary by account, the safest approach is to treat Mailgun’s own verification screen as the source of truth. Small differences in a DKIM selector, host field, or DMARC value can prevent successful verification.
Final outcome
The DNS and Mailgun connection work was completed, and the task was closed after the developer confirmed the setup was finished.
The broader lesson is that a Mailgun connection problem in WordPress may actually be a DNS-authentication problem. If the plugin is already installed but the new sending account is not working, check Mailgun’s domain-verification status and confirm that its SPF, DKIM, MX, CNAME, and DMARC records have been added to the correct DNS zone.
If you need help connecting Mailgun to WordPress, configuring DNS authentication, or troubleshooting transactional email delivery, contact Freshy. Our WordPress team can help with Mailgun, DNS verification, SPF, DKIM, DMARC, and email-delivery troubleshooting.