1

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', 'xyz@mailinator.com', ['xxxx@gmail.com'])

It gives an error:

AnymailRequestsAPIError: Sending a message to xxxx@gmail.com from xyz@mailinator.com
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 = "no-reply@mailinator.com"
solarissmoke
  • 30,039
  • 14
  • 71
  • 73
kaushikdr
  • 1,699
  • 2
  • 12
  • 18
  • Looks like a duplicate of [this question](http://stackoverflow.com/questions/37375532/mailgun-domain-not-found-abc-com). Also you probably shouldn't be spoofing a `mailinator.com` address. – solarissmoke Jul 23 '16 at 13:14
  • Tried this. Still not working. Its gives "message": "Domain not found: mg.mailinator.com" – kaushikdr Jul 23 '16 at 13:18

1 Answers1

2

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.

Aric Kuter
  • 415
  • 3
  • 12
medmunds
  • 5,950
  • 3
  • 28
  • 51