all-auth SMTPAuthentication错误

问题描述 投票:0回答:1

我得到SMTPAuthenticationError at /rest-auth/password/reset/错误。

我正在使用all-auth-rest并在settings.py上设置它们

EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = 'randomemail@gmail.com'
EMAIL_PORT = 25 # or 587
EMAIL_HOST_PASSWORD = 'mypassword'

我也启用了Displaying an Unlock Captcha并允许less secure app access

缺什么?

谢谢

django smtp django-allauth django-settings
1个回答
1
投票

这种配置是如果您使用smtp.gmail.com,其他smtp与此配置类似。

  1. 解锁验证码:qazxsw poi
  2. 更改为有效:https://accounts.google.com/DisplayUnlockCaptcha

https://www.google.com/settings/security/lesssecureapps

我想你错过了:EMAIL_HOST = 'smtp.gmail.com' EMAIL_PORT = 587 EMAIL_HOST_USER = 'your_gmail@gmail.com' EMAIL_HOST_PASSWORD = 'your_password' EMAIL_USE_TLS = True DEFAULT_FROM_EMAIL = EMAIL_HOST_USER EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.