Mailgun Domain not found: abc.com

前端 未结 7 1228
遇见更好的自我
遇见更好的自我 2021-02-07 00:17

I am trying to setup emails with my own website. Let\'s say the domain name is abc.com.

The nameserver in use is digital ocean and I also have a gmail accou

7条回答
  •  忘掉有多难
    2021-02-07 00:32

    IF:

    • your domain is an EU domain AND
    • you're using django-anymail as in Rob's answer above

    THEN the ANYMAIL setting (in your Django project settings) should specify the API_URL to be the EU one, example:

    ANYMAIL = {
        'MAILGUN_API_KEY': '',
        'MAILGUN_SENDER_DOMAIN': 'abc.eu',
        'MAILGUN_API_URL': 'https://api.eu.mailgun.net/v3'  # this line saved me!
    }
    

    Before adding the MAILGUN_API_URL I was getting this error:

    AnymailRequestsAPIError: Sending a message to xxx@yyy.com from noreply@abc.eu 
    Mailgun API response 404 (NOT FOUND):
    {
      "message": "Domain not found: mailgun.abc.eu"
    }
    

提交回复
热议问题