Read extra headers for mail from config
This commit is contained in:
parent
f54c9cfbb7
commit
3163bca99b
|
@ -24,6 +24,10 @@ def send_mail(subject: str, body: str) -> None:
|
||||||
msg["Date"] = formatdate()
|
msg["Date"] = formatdate()
|
||||||
msg["Message-ID"] = make_msgid()
|
msg["Message-ID"] = make_msgid()
|
||||||
|
|
||||||
|
# Add extra mail headers
|
||||||
|
for header, value in config.getattr("MAIL_HEADERS", []):
|
||||||
|
msg[header] = value
|
||||||
|
|
||||||
msg.set_content(body)
|
msg.set_content(body)
|
||||||
|
|
||||||
s = smtplib.SMTP(config.SMTP_HOST)
|
s = smtplib.SMTP(config.SMTP_HOST)
|
||||||
|
|
Loading…
Reference in a new issue