mirror of
https://github.com/plantroon/acme.sh.git
synced 2024-12-22 13:11:41 +00:00
Add Date email header in Python implementation
This commit is contained in:
parent
5a182eddbf
commit
8f688e5e13
@ -287,6 +287,7 @@ try:
|
|||||||
from email.message import EmailMessage
|
from email.message import EmailMessage
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from email.mime.text import MIMEText as EmailMessage # Python 2
|
from email.mime.text import MIMEText as EmailMessage # Python 2
|
||||||
|
from email.utils import formatdate as rfc2822_date
|
||||||
from smtplib import SMTP, SMTP_SSL, SMTPException
|
from smtplib import SMTP, SMTP_SSL, SMTPException
|
||||||
from socket import error as SocketError
|
from socket import error as SocketError
|
||||||
except ImportError as err:
|
except ImportError as err:
|
||||||
@ -318,6 +319,7 @@ except (AttributeError, TypeError):
|
|||||||
msg["Subject"] = subject
|
msg["Subject"] = subject
|
||||||
msg["From"] = from_email
|
msg["From"] = from_email
|
||||||
msg["To"] = to_emails
|
msg["To"] = to_emails
|
||||||
|
msg["Date"] = rfc2822_date(localtime=True)
|
||||||
msg["X-Mailer"] = x_mailer
|
msg["X-Mailer"] = x_mailer
|
||||||
|
|
||||||
smtp = None
|
smtp = None
|
||||||
|
Loading…
Reference in New Issue
Block a user