comparison sat/tools/common/email.py @ 3034:ca6c695c65da

tools (common/email): fixed email sending after python 3 port
author Goffi <goffi@goffi.org>
date Fri, 16 Aug 2019 17:06:52 +0200
parents ab2696e34d29
children 9d0df638c8b4
comparison
equal deleted inserted replaced
3033:0d55a52056f7 3034:ca6c695c65da
60 60
61 return smtp.sendmail( 61 return smtp.sendmail(
62 email_host.encode("utf-8"), 62 email_host.encode("utf-8"),
63 email_from.encode("utf-8"), 63 email_from.encode("utf-8"),
64 [email.encode("utf-8") for email in to_emails], 64 [email.encode("utf-8") for email in to_emails],
65 msg.as_string(), 65 msg.as_bytes(),
66 senderDomainName=email_sender_domain.encode("utf-8") if email_sender_domain 66 senderDomainName=email_sender_domain.encode("utf-8") if email_sender_domain
67 else None, 67 else None,
68 port=email_port, 68 port=email_port,
69 username=email_username.encode("utf-8") if email_username else None, 69 username=email_username.encode("utf-8") if email_username else None,
70 password=email_password.encode("utf-8") if email_password else None, 70 password=email_password.encode("utf-8") if email_password else None,