所有身份验证 SMTP 系统错误



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

我正在使用全身份验证休息并将它们设置为 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

缺少什么?

谢谢

如果您使用smtp.gmail.com,则此配置与此配置类似。

  1. 解锁卡普塔:https://accounts.google.com/DisplayUnlockCaptcha
  2. 更改为活动: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'

我想你错过了:EMAIL_BACKEND

最新更新