我已经设置了django-allauth,并且一切正常,但是生成的电子邮件(例如,通过重置密码生成的)来自本地主机,而不是我想要的发件人。
在测试电子邮件中使用django.core.mail send_mail命令时,我们的电子邮件使用sendgrid并与正确的发件人一起发送
我缺少设置吗?
这些是我拥有的(以及sendgrid密码):
EMAIL_HOST = 'smtp.sendgrid.net'
EMAIL_HOST_USER = '******' # This works in test emails
EMAIL_PORT = 587
EMAIL_USE_TLS = True
ACCOUNT_LOGIN_ATTEMPTS_LIMIT = 10
ACCOUNT_SIGNUP_FORM_CLASS = '******.views.SignupForm'
ACCOUNT_AUTHENTICATION_METHOD = 'email'
ACCOUNT_EMAIL_REQUIRED = True
ACCOUNT_UNIQUE_EMAIL = True
ACCOUNT_USERNAME_REQUIRED = False
ACCOUNT_EMAIL_VERIFICATION = 'none'
谢谢!
答案 0 :(得分:1)
设置为DEFAULT_FROM_EMAIL
即:
DEFAULT_FROM_EMAIL = "info@website.com"