利用flask Gmail发送邮件 一直出问题 因为账号密码都是对的
所以 到处搜索发现
然后在stack overflow 上面发现了一个回答
Your code looks correct. Try logging in through your browser and if you are able to access your account come back and try your code again. Just make sure that you have typed your username and password correct
EDIT: Google blocks sign-in attempts from apps which do not use modern security standards (mentioned on their support page). You can however, turn on/off this safety feature by going to the link below:
Go to this link and select Turn On
https://www.google.com/settings/security/lesssecureapps
允许不够安全的应用
问题出现在了 这个Google的安全设置上面没有打开
打开了之后就解决了
在使用Flask-Mail通过Gmail发送邮件时遇到障碍,原因是Google的安全设置阻止了不安全应用的登录尝试。参照Google支持页面的提示,需在账户设置中开启'允许不够安全的应用'选项,启用这一设置后,问题得到解决。

被折叠的 条评论
为什么被折叠?



