From 051b6c0e0a04793797f45cd1bd201158dd8ef4b4 Mon Sep 17 00:00:00 2001 From: Johannes Findeisen Date: Thu, 19 Sep 2013 22:20:42 +0200 Subject: [PATCH] added Date to mail header. --- lib/tasks/mail.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/tasks/mail.py b/lib/tasks/mail.py index c03114d..177fe86 100644 --- a/lib/tasks/mail.py +++ b/lib/tasks/mail.py @@ -4,6 +4,7 @@ The mail task. http://docs.python.org/2/library/email-examples.html """ +import datetime import smtplib from email.mime.text import MIMEText from lib.tasks.task import Task @@ -21,6 +22,8 @@ class MailTask(Task): def execute(self, msg): message = MIMEText(msg) message['Subject'] = 'Warning from Linspector' + now = datetime.datetime.now() + message['Date'] = now.strftime("%a, %d %b %Y %H:%M:%S") message['From'] = "warning@linspector.org" message['To'] = self.recipient s = smtplib.SMTP('localhost')