Mercurial > libervia-backend
comparison sat/tools/email.py @ 2951:c8cd5c30fb2e
tools (email): fixed bad default value while reading config
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 14 May 2019 20:16:45 +0200 |
parents | 003b8b4b56a7 |
children |
comparison
equal
deleted
inserted
replaced
2950:fdd7285ddd83 | 2951:c8cd5c30fb2e |
---|---|
48 email_from = u"no_reply@" + domain | 48 email_from = u"no_reply@" + domain |
49 email_sender_domain = host.memory.getConfig(None, u"email_sender_domain") | 49 email_sender_domain = host.memory.getConfig(None, u"email_sender_domain") |
50 email_port = int(host.memory.getConfig(None, u"email_port", 25)) | 50 email_port = int(host.memory.getConfig(None, u"email_port", 25)) |
51 email_username = host.memory.getConfig(None, u"email_username") | 51 email_username = host.memory.getConfig(None, u"email_username") |
52 email_password = host.memory.getConfig(None, u"email_password") | 52 email_password = host.memory.getConfig(None, u"email_password") |
53 email_auth = C.bool(host.memory.getConfig(None, "email_auth", False)) | 53 email_auth = C.bool(host.memory.getConfig(None, "email_auth", C.BOOL_FALSE)) |
54 email_starttls = C.bool(host.memory.getConfig(None, "email_starttls", False)) | 54 email_starttls = C.bool(host.memory.getConfig(None, "email_starttls", C.BOOL_FALSE)) |
55 | 55 |
56 msg = MIMEText(body, "plain", "UTF-8") | 56 msg = MIMEText(body, "plain", "UTF-8") |
57 msg[u"Subject"] = subject | 57 msg[u"Subject"] = subject |
58 msg[u"From"] = email_from | 58 msg[u"From"] = email_from |
59 msg[u"To"] = u", ".join(to_emails) | 59 msg[u"To"] = u", ".join(to_emails) |