I am trying to integrate django-anymail with mailgun. When I send a mail with django send_mail as
send_mail('Testing', 'Test dsadsadsa asdsa body', '[email protected]', ['[email protected]'])
It gives an error:
AnymailRequestsAPIError: Sending a message to [email protected] from [email protected]
ESP API response 404:
{
"message": "Domain not found: mailinator.com"
}
How can I get rid of this?
My settings file contains this:
ANYMAIL = {
"MAILGUN_API_KEY": "key-xxxmyprivatekey",
}
EMAIL_BACKEND = "anymail.backends.mailgun.MailgunBackend"
DEFAULT_FROM_EMAIL = "[email protected]"
It sounds like you have not verified your sending domain in Mailgun. Anymail is reporting the API error directly from your ESP, Mailgun, which is complaining they can't find the domain you're trying to send from.
Sign into your Mailgun account and check the domains list in their dashboard. Is mg.mailinator.com listed there with a green "Active" badge? If not, add it if necessary, and then follow Mailgun's instructions to verify the domain.