How to configure Mailgun without conflicts from Microsoft 365

Setting up Mailgun alongside Microsoft 365 can be challenging when both services need DNS records for the same domain. A proper configuration strategy allows transactional emails to be sent reliably without disrupting existing business email services.

Issue Background

Organizations often adopt Mailgun for transactional email delivery while continuing to use Microsoft 365 for employee mailboxes. Problems can occur when Mailgun is configured directly on the primary domain, creating DNS conflicts with existing Microsoft 365 records.

Diagnosis

Mailgun requires MX, TXT, SPF, and verification records to operate correctly. Attempting to place these records on a domain already configured for Microsoft 365 can create conflicts that affect email delivery and authentication.

Resolution Steps

Create a dedicated Mailgun subdomain such as mg.example.com, add Mailgun’s required DNS records to that subdomain, leave Microsoft 365 records unchanged on the root domain, configure the Mailgun WordPress plugin with the subdomain and API credentials, and perform email delivery testing.

Final Outcome

By separating Mailgun onto a dedicated subdomain, transactional emails could be delivered reliably without affecting Microsoft 365 mailbox functionality. This approach simplifies DNS management while improving deliverability and authentication. If you’re troubleshooting Mailgun setup, Microsoft 365 email conflicts, or WordPress email delivery issues, contact Freshy.