mirror of
https://github.com/django/django.git
synced 2024-12-23 01:25:58 +00:00
Fixed #1634 -- Changed django.core.mail to include 'Date' header in e-mails. Thanks, Eric Walstad
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2984 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
fd16f1468a
commit
f375b54503
@ -3,7 +3,7 @@
|
|||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from email.MIMEText import MIMEText
|
from email.MIMEText import MIMEText
|
||||||
from email.Header import Header
|
from email.Header import Header
|
||||||
import smtplib
|
import smtplib, rfc822
|
||||||
|
|
||||||
class BadHeaderError(ValueError):
|
class BadHeaderError(ValueError):
|
||||||
pass
|
pass
|
||||||
@ -49,6 +49,7 @@ def send_mass_mail(datatuple, fail_silently=False, auth_user=settings.EMAIL_HOST
|
|||||||
msg['Subject'] = subject
|
msg['Subject'] = subject
|
||||||
msg['From'] = from_email
|
msg['From'] = from_email
|
||||||
msg['To'] = ', '.join(recipient_list)
|
msg['To'] = ', '.join(recipient_list)
|
||||||
|
msg['Date'] = rfc822.formatdate()
|
||||||
try:
|
try:
|
||||||
server.sendmail(from_email, recipient_list, msg.as_string())
|
server.sendmail(from_email, recipient_list, msg.as_string())
|
||||||
num_sent += 1
|
num_sent += 1
|
||||||
|
Loading…
Reference in New Issue
Block a user