Read extra headers for mail from config

This commit is contained in:
Edward Betts 2024-02-11 07:15:08 +00:00
parent f54c9cfbb7
commit 3163bca99b

View file

@ -24,6 +24,10 @@ def send_mail(subject: str, body: str) -> None:
msg["Date"] = formatdate()
msg["Message-ID"] = make_msgid()
# Add extra mail headers
for header, value in config.getattr("MAIL_HEADERS", []):
msg[header] = value
msg.set_content(body)
s = smtplib.SMTP(config.SMTP_HOST)