mirror of
https://github.com/evilhero/mylar
synced 2025-01-03 05:24:43 +00:00
IMP:(#2352) Added Date and Message-ID Headers to Email Notifications
This commit is contained in:
parent
66897c1549
commit
0cc6523115
1 changed files with 3 additions and 0 deletions
|
@ -30,6 +30,7 @@ import requests
|
||||||
import smtplib
|
import smtplib
|
||||||
from email.mime.multipart import MIMEMultipart
|
from email.mime.multipart import MIMEMultipart
|
||||||
from email.mime.text import MIMEText
|
from email.mime.text import MIMEText
|
||||||
|
from email.utils import formatdate, make_msgid
|
||||||
|
|
||||||
# This was obviously all taken from headphones with great appreciation :)
|
# This was obviously all taken from headphones with great appreciation :)
|
||||||
|
|
||||||
|
@ -383,6 +384,8 @@ class EMAIL:
|
||||||
msg['From'] = str(self.emailfrom)
|
msg['From'] = str(self.emailfrom)
|
||||||
msg['To'] = str(self.emailto)
|
msg['To'] = str(self.emailto)
|
||||||
msg['Subject'] = subject
|
msg['Subject'] = subject
|
||||||
|
msg['Date'] = formatdate()
|
||||||
|
msg['Message-ID'] = make_msgid('mylar')
|
||||||
msg.attach(MIMEText(message, 'plain'))
|
msg.attach(MIMEText(message, 'plain'))
|
||||||
|
|
||||||
if self.emailenc is 1:
|
if self.emailenc is 1:
|
||||||
|
|
Loading…
Reference in a new issue