微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Django发送gmail失败

如何解决Django发送gmail失败

我在设置文件中配置了 gmail,如下所示:

#gmail_send/settings.py
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = 'yoorusername@gmail.com'
EMAIL_HOST_PASSWORD = 'key' #past the key or password app here
EMAIL_PORT = 587
EMAIL_USE_TLS = True
DEFAULT_FROM_EMAIL = 'default from email'

我已经从谷歌开启了安全性较低的应用访问,但它仍然无法正常工作

这里是错误

SMTPSenderRefused at /register
(530,b'5.7.0 Authentication required. Learn more at\n5.7.0  https://support.google.com/mail/?p=WantAuthError n6sm1130142pgm.79 - gsmtp','"default from email"')
Request Method: POST
Request URL:    http://127.0.0.1:8000/register
Django Version: 3.2.3
Exception Type: SMTPSenderRefused
Exception Value:    
(530,'"default from email"')

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。