Fixing anymail/mailgun "Domain not found" error

Oct 03, 2019 · by Tim Kamanin

Are you swearing at mailgun now? Have you smashed your keyboard already? Do you keep receiving the Domain not found: error although you're 100% sure you've set everything up correctly?

Yeah, I've been there and probably, I have a solution for you.

Chances are, your domain is set as EU in mailgun. Make sure you use correct API base URL in this case:, note the eu part. Update example snippets that mailgun gave you with this endpoint and everything should start working just fine.

I'm on Django, and I use Anymail

Me too! Make sure you've added european mailgiun API URL to

    'MAILGUN_API_URL': '' # add this line!

That should be it; now you're happy european mailgun user! You're welcome!

Want to get more 🔥 tips like this one?

Subscribe to get notified about new dev tutorials