Some mailserver require the Date header

This commit is contained in:
sfigato 2022-09-27 23:04:12 +02:00
parent 51b4e6c112
commit 635780b353
Signed by: blallo
GPG Key ID: 0CBE577C9B72DC3F

View File

@ -1,5 +1,6 @@
# -*- encoding: utf-8 -*-
from contextlib import contextmanager
from datetime import datetime
from email import encoders
from email.mime.base import MIMEBase
from email.mime.multipart import MIMEMultipart
@ -62,6 +63,7 @@ class Notifier(object):
body = f"Resoconto dei voli dal sito di AdR per l'aereoporto di Ciampino in data {date}" # noqa: E501
message = MIMEMultipart()
message["Date"] = datetime.now().strftime("%a, %d %b %Y %H:%M:%S %z")
message["From"] = self._from
message["To"] = ",".join(to)
if cc:
@ -95,6 +97,7 @@ il vostro tecnico preferito.
"""
message = MIMEMultipart()
message["Date"] = datetime.now().strftime("%a, %d %b %Y %H:%M:%S %z")
message["From"] = self._from
message["To"] = ",".join(to)
if cc: