Having problems sending via Mailgun to Gmail

AI-generated summary

BlackBelt35 reported an issue where emails sent via Mailgun’s SMTP credentials through Discourse were not being delivered to Gmail addresses, despite working for other providers like Hotmail, Yahoo, and GMX. Notably, Mailgun’s API via WordPress worked fine for Gmail, suggesting the problem was specific to Discourse’s SMTP setup. Stephen reassured that Mailgun commonly works with Discourse and Gmail, suggesting DNS configuration issues—particularly if the domain used for sending has MX records or is tied to a G Suite account. pfaffman advised checking Discourse and Mailgun logs and opening a support ticket, emphasizing that the sending domain must be properly activated in Mailgun. Ultimately, BlackBelt35 resolved the issue: it was caused by a DMARC security protocol mismatch—the sender email address must exactly match the domain registered in Mailgun. This fix restored Gmail deliverability, preventing potential loss of subscribers.

Hello everyone. :slight_smile:

I’ve recently installed a Discourse instance to serve the community purposes of my website. And used Mailgun’s SMTP credentials for emailing. Setup goes fine, and I received the setup email on my GMX adress.

But after I’ve tried to send private invites to my closest friends, it appears Gmail adresses aren’t received emails. It works for hotmail, yahoo, GMX, and all others major platforms, but not Gmail.

For your information, I use Mailgun’s API with Mailgun WordPress extension to manage emailing from my webzine. Totally works fine, even for Gmail adresses.

So why it doesn’t work with SMTP credentials in Discourse ? And why only with Gmail adresses ? Does someone have a hint or any idea about this ?

I really need to fix this issue, I don’t want to lose 30% of potential subscriptions because of this problem.

Thanks ! :slight_smile:

Mailgun absolutely works with Discourse routing to Gmail, it’s one of the most common configurations.

Do you have a g suite account on the same domain? Does discourse route from a separate subdomain, or one which has MX records configured for inbound mail relay to another provider?

This is very likely to be DNS related.

I’d check your logs but in discourse and mailgun and open a ticket with them. You should check that the domain name you are sending from is one that Mailgun has activated.

Problem fixed. It was a simple problem with DMARC security protocol : the sending email adress needs to match with the domain registered in Mailgun. Thanks ! :slight_smile: