Sorry, unexpected error: 'module' object has no attribute 'SMTP_SSL'

倾然丶 夕夏残阳落幕 提交于 2019-12-04 21:50:39

You have set the MAIL_USE_SSL option to True:

app.config['MAIL_USE_SSL'] = True

which means that the Flask-Mail extension will want to use the smtplib.SMTP_SSL class, but that class isn't usually available on Google App Engine.

That class is only available if the Python ssl module is available, which is only the case if your Python was built with SSL support available. This isn't normally the case in the GAE environment.

The module is not available on Google App Engine unless you specifically enable it. Enable it in your app.yaml:

libraries:
- name: ssl
  version: latest

Do note that the socket support on GAE is experimental.

For sending email on GAE you are better off using the mail.send_mail() function however, so you can make use of the GAE infrastructure instead.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!