Update tools.py
Fixed email date header not respecting the RFC2822 defined format See: https://groups.google.com/forum/#!topic/web2py/0Mb99H9kJOw
This commit is contained in:
+2
-2
@@ -23,6 +23,7 @@ import urllib2
|
|||||||
import Cookie
|
import Cookie
|
||||||
import cStringIO
|
import cStringIO
|
||||||
import ConfigParser
|
import ConfigParser
|
||||||
|
import email.utils
|
||||||
from email import MIMEBase, MIMEMultipart, MIMEText, Encoders, Header, message_from_string, Charset
|
from email import MIMEBase, MIMEMultipart, MIMEText, Encoders, Header, message_from_string, Charset
|
||||||
|
|
||||||
from gluon.contenttype import contenttype
|
from gluon.contenttype import contenttype
|
||||||
@@ -666,8 +667,7 @@ class Mail(object):
|
|||||||
if bcc:
|
if bcc:
|
||||||
to.extend(bcc)
|
to.extend(bcc)
|
||||||
payload['Subject'] = encoded_or_raw(subject.decode(encoding))
|
payload['Subject'] = encoded_or_raw(subject.decode(encoding))
|
||||||
payload['Date'] = time.strftime("%a, %d %b %Y %H:%M:%S +0000",
|
payload['Date'] = email.utils.formatdate()
|
||||||
time.gmtime())
|
|
||||||
for k, v in headers.iteritems():
|
for k, v in headers.iteritems():
|
||||||
payload[k] = encoded_or_raw(v.decode(encoding))
|
payload[k] = encoded_or_raw(v.decode(encoding))
|
||||||
result = {}
|
result = {}
|
||||||
|
|||||||
Reference in New Issue
Block a user