考虑来自https://github.com/anymail/django-anymail的以下settings.py
代码段:
INSTALLED_APPS = [
# ...
"anymail",
# ...
]
ANYMAIL = {
# (exact settings here depend on your ESP...)
"MAILGUN_API_KEY": "<your Mailgun key>",
"MAILGUN_SENDER_DOMAIN": 'mg.example.com', # your Mailgun domain, if needed
}
EMAIL_BACKEND = "anymail.backends.mailgun.EmailBackend" # or sendgrid.EmailBackend, or...
DEFAULT_FROM_EMAIL = "you@example.com" # if you don't already have this in settings
在此示例中,MAILGUN_SENDER_DOMAIN
和DEFAULT_FROM_EMAIL
都拥有域example.com
。
我们最近做了一些更改,这两个域名不同,似乎我无法再使用AnyMail后端发送电子邮件了。我的理论是MailGun强制执行&#39;这两个域是相同的,但我从文档中不清楚这是否确实如此。任何人都可以确认这是否是必需的?