Email debug mode on Python 3 was printing bytestring representation for subject body

There's nothing useful about seeing b'foo\nbar\nbaz' printing to
stdout.  That's not what the user should get!
This commit is contained in:
Christopher Allan Webber 2016-02-25 15:38:28 -08:00
parent 3d78038a3c
commit 7e550fcb9d

View File

@ -137,7 +137,7 @@ def send_email(from_addr, to_addrs, subject, message_body):
print("To addresses: %s" % message['To'])
print("Subject: %s" % message['Subject'])
print("-- Body: --")
print(message.get_payload(decode=True))
print(message_body)
return mhost.sendmail(from_addr, to_addrs, message.as_string())