On my local server, I get this error when trying to send a mail
INFO 2017-03-01 16:54:06,819 mail_stub.py:143] MailService.Send
From: None "no-reply@None.appspotmail.com"
To: v*****@d******.com
Subject: Du contenu arrive à expiration (alldigital@test.gpartner.eu)
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
My code is:
def send(recipient, subject, body):
message = mail.EmailMessage(
sender=u'{} <no-reply@{}.appspotmail.com>'.format(app_identity.get_application_id(),
app_identity.get_application_id()),
subject=subject,
body=body,
to=recipient
)
message.check_initialized()
message.send()
And I have no clue of what's wrong. D you have any to solve this issue or some things I could try to debug ?
Thanks for your help
send()
? The error message is following the info msg frommail_stub.py
, meaning it could actually be caused by something else aftersend()
completes. Maybe add a debug print aftersend()
to check this theory? – Dan Cornilescu