在我的本地服务器上,我尝试发送邮件“NoneType”对象的AppEngine邮件不是可迭代发送
INFO 2017-03-01 16:54:06,819 mail_stub.py:143] MailService.Send
From: None "[email protected]"
To: v*****@d******.com
Subject: Du contenu arrive à expiration ([email protected])
Body:
Content-type: text/plain
Data length: 50
INFO 2017-03-01 16:54:06,819 mail_stub.py:306] You are not currently sending out real email. If you have sendmail installed you can use it by using the server with --enable_sendmailERROR 2017-03-01 16:48:43,630 wsgi.py:279] Traceback (most recent call last):
File "/home/*****/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 268, in Handle
for chunk in result:
TypeError: 'NoneType' object is not iterable
我的代码时出现此错误是:
def send(recipient, subject, body):
message = mail.EmailMessage(
sender=u'{} <[email protected]{}.appspotmail.com>'.format(app_identity.get_application_id(),
app_identity.get_application_id()),
subject=subject,
body=body,
to=recipient
)
message.check_initialized()
message.send()
而且我有没有线索发生什么错误。你有什么可以解决这个问题或者我可以尝试调试的一些东西?
感谢您的帮助
你可以显示调用'send()'的代码吗?这个错误信息是来自'mail_stub.py'的信息msg *,意思是**'send()'完成后它可能实际上是由其他的**造成的。也许在'send()'之后添加一个调试打印来检查这个理论? –