贴出部分代码:
app.config['MAIL_SERVER'] = 'smtp.163.com'
app.config['MAIL_PORT'] = '994'
app.config['MAIL_USE_SSL'] = True
app.config['MAIL_USERNAME'] = '我的手机@163.com'
app.config['MAIL_PASSWORD'] = '我的登录密码'
msg = Message('test', sender='我的手机@163.com', recipients=['xxxxxxx@qq.com'])
msg.body = '文本 body'
msg.html = '<b>HTML</b> body'
with app.app_context():
mail.send(mail)
运行后出现以下错误:
从上面错误看起来好像是send的错误,而且错误原因应该是没有实现的命令,但是这不是flask-mail的写法吗?smtp用的是网易邮箱,按照它所说的去配置,应该是没有问题才对的。。。
The following is an example of sending an email
You don’t have to
SSL
试试,或者用TLS
Change the port to 25 and try againSet the port number to 25 and try it. In addition, the port number should be a number