diff -r ef03aff3b195 Doc/includes/email-simple.py --- a/Doc/includes/email-simple.py Wed Dec 21 23:43:50 2016 -0500 +++ b/Doc/includes/email-simple.py Thu Dec 22 10:18:23 2016 -0500 @@ -3,7 +3,7 @@ # Import the email modules we'll need from email.mime.text import MIMEText - +from email.utils import formatdate # Open a plain text file for reading. For this example, assume that # the text file contains only ASCII characters. fp = open(textfile, 'rb') @@ -16,6 +16,8 @@ msg['Subject'] = 'The contents of %s' % textfile msg['From'] = me msg['To'] = you +#RFC 5322 needs date to be present +msg['Date'] = formatdate(localtime=True) # Send the message via our own SMTP server, but don't include the # envelope header.