【问题标题】:Django SendGrid + allauthDjango SendGrid + allauth
【发布时间】:2020-05-17 14:09:51
【问题描述】:

我目前正在尝试实施 SendGrid,以便为注册的社交帐户用户发送确认电子邮件,我收到以下错误

SMTPDataError at /accounts/facebook/login/callback/
(550, b'The from address does not match a verified Sender Identity. Mail cannot be sent until this error is resolved. Visit https://sendgrid.com/docs/for-developers/sending-email/sender-identity/ to see the Sender Identity requirements')

我已经在 SendGrid 上完成了单发件人验证,所以在这方面一切都应该没问题,但是我也联系了 SendGrid,以防万一。 以下是我的设置,以防我可能遗漏了什么?

EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_HOST_USER = 'apikey' # this is exactly the value 'apikey'
EMAIL_HOST_PASSWORD = config('SENDGRID_API_KEY')
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'

非常感谢任何帮助。

【问题讨论】:

    标签: django sendgrid django-allauth


    【解决方案1】:

    我自己遇到了这个问题 - 除了上述设置之外,您还需要以下两个设置:

    EMAIL_HOST = 'smtp.sendgrid.net'
    # the email you verified with sendgrid (if you did single sender verification)
    DEFAULT_FROM_EMAIL = 'myverifiedemailaddress@provider.com'
    

    【讨论】:

      猜你喜欢
      • 2021-01-18
      • 2014-08-30
      • 2014-09-13
      • 2017-04-13
      • 2013-06-01
      • 2012-06-19
      • 2016-05-16
      • 2019-11-23
      • 1970-01-01
      相关资源
      最近更新 更多