From 635780b35382d6dfe872101be3233211e3b209f9 Mon Sep 17 00:00:00 2001 From: Blallo Date: Tue, 27 Sep 2022 23:04:12 +0200 Subject: [PATCH] Some mailserver require the Date header --- latecomers/notifier.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/latecomers/notifier.py b/latecomers/notifier.py index 9e45517..d72f6eb 100644 --- a/latecomers/notifier.py +++ b/latecomers/notifier.py @@ -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: