diff --git a/backend/mailer.py b/backend/mailer.py index c29f105..5c47ee1 100644 --- a/backend/mailer.py +++ b/backend/mailer.py @@ -16,6 +16,7 @@ from datetime import datetime from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from email.mime.application import MIMEApplication +from email.utils import formatdate import httpx @@ -92,6 +93,7 @@ def _build_mime_copy(to: str, subject: str, html: str, plain: str, attachments: msg["Subject"] = subject msg["From"] = SMTP_FROM msg["To"] = to + msg["Date"] = formatdate(localtime=False) return msg @@ -154,6 +156,7 @@ def _send_smtp_sync(to: str, subject: str, html: str, plain: str, attachments: l msg["Subject"] = subject msg["From"] = SMTP_FROM msg["To"] = to + msg["Date"] = formatdate(localtime=False) msg_bytes = msg.as_bytes() with smtplib.SMTP(SMTP_HOST, SMTP_PORT, timeout=10) as s: