From 8546521d9bf76e831c9379c4204fb7497101a7a7 Mon Sep 17 00:00:00 2001 From: Jacob Kaplan-Moss Date: Sun, 25 Feb 2007 15:55:31 +0000 Subject: [PATCH] Fixed #3554: django.core.mail now generates dates with the email module instead of the outdated rfc822 module. Thanks, real.human@mrmachine.net git-svn-id: http://code.djangoproject.com/svn/django/trunk@4570 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/mail.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/django/core/mail.py b/django/core/mail.py index cc99659adb..1ec64e9e17 100644 --- a/django/core/mail.py +++ b/django/core/mail.py @@ -3,7 +3,8 @@ from django.conf import settings from email.MIMEText import MIMEText from email.Header import Header -import smtplib, rfc822 +from email.Utils import formatdate +import smtplib import socket import time import random @@ -65,7 +66,7 @@ def send_mass_mail(datatuple, fail_silently=False, auth_user=settings.EMAIL_HOST msg['Subject'] = subject msg['From'] = from_email msg['To'] = ', '.join(recipient_list) - msg['Date'] = rfc822.formatdate() + msg['Date'] = formatdate() try: random_bits = str(random.getrandbits(64)) except AttributeError: # Python 2.3 doesn't have random.getrandbits().