ERROR 2021-01-25 09:36:07,303 api_server.py:385] Exception while handling mail.Send()
Traceback (most recent call last):
File "/home/hjianhao/dev/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/api_server.py", line 353, in _handle_POST
api_response = _execute_request(request).Encode()
File "/home/hjianhao/dev/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/api_server.py", line 169, in _execute_request
make_request()
File "/home/hjianhao/dev/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/api_server.py", line 164, in make_request
request_id)
File "/home/hjianhao/dev/google-cloud-sdk/platform/google_appengine/google/appengine/api/apiproxy_stub.py", line 151, in MakeSyncCall
method(request, response)
File "/home/hjianhao/dev/google-cloud-sdk/platform/google_appengine/google/appengine/api/mail_stub.py", line 374, in _Send
self._SendSMTP(mime_message, smtp_lib)
File "/home/hjianhao/dev/google-cloud-sdk/platform/google_appengine/google/appengine/api/mail_stub.py", line 295, in _SendSMTP
smtp.quit()
File "/usr/lib/python2.7/smtplib.py", line 773, in quit
res = self.docmd("quit")
File "/usr/lib/python2.7/smtplib.py", line 394, in docmd
self.putcmd(cmd, args)
File "/usr/lib/python2.7/smtplib.py", line 342, in putcmd
self.send(str)
File "/usr/lib/python2.7/smtplib.py", line 334, in send
raise SMTPServerDisconnected('please run connect() first')
SMTPServerDisconnected: please run connect() first
WARNING 2021-01-25 09:36:07,306 BaseHandler.py:175] sendmail to xxx@kindle.cn failed:SMTPServerDisconnected('please run connect() first',).
运行参数如下: dev_appserver.py \ --host=0.0.0.0 \ --enable_host_checking=False \ --smtp_host=smtp.qq.com \ --smtp_port=587 \ --smtp_user=xxx@qq.com \ --smtp_password=xxxx(qq邮箱授权码 \ --smtp_allow_tls=True \ ./app.yaml ./module-worker.yaml
错误如下。 用户名密码是设置对的,设置错了会有认证错误,不是下面的错误。试了qq,outlook,gmail都是同样错误。
ERROR 2021-01-25 09:36:07,303 api_server.py:385] Exception while handling mail.Send() Traceback (most recent call last): File "/home/hjianhao/dev/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/api_server.py", line 353, in _handle_POST api_response = _execute_request(request).Encode() File "/home/hjianhao/dev/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/api_server.py", line 169, in _execute_request make_request() File "/home/hjianhao/dev/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/api_server.py", line 164, in make_request request_id) File "/home/hjianhao/dev/google-cloud-sdk/platform/google_appengine/google/appengine/api/apiproxy_stub.py", line 151, in MakeSyncCall method(request, response) File "/home/hjianhao/dev/google-cloud-sdk/platform/google_appengine/google/appengine/api/mail_stub.py", line 374, in _Send self._SendSMTP(mime_message, smtp_lib) File "/home/hjianhao/dev/google-cloud-sdk/platform/google_appengine/google/appengine/api/mail_stub.py", line 295, in _SendSMTP smtp.quit() File "/usr/lib/python2.7/smtplib.py", line 773, in quit res = self.docmd("quit") File "/usr/lib/python2.7/smtplib.py", line 394, in docmd self.putcmd(cmd, args) File "/usr/lib/python2.7/smtplib.py", line 342, in putcmd self.send(str) File "/usr/lib/python2.7/smtplib.py", line 334, in send raise SMTPServerDisconnected('please run connect() first') SMTPServerDisconnected: please run connect() first
WARNING 2021-01-25 09:36:07,306 BaseHandler.py:175] sendmail to xxx@kindle.cn failed:SMTPServerDisconnected('please run connect() first',).