Ticket #1634: django_core_mail.diff

File django_core_mail.diff, 672 bytes (added by eric@…, 18 years ago)

Patch to add RFC 822 Date header to send_mail function

  • django/core/mail.py

     
    33from django.conf import settings
    44from email.MIMEText import MIMEText
    55from email.Header import Header
    6 import smtplib
     6import smtplib, rfc822
    77
    88class BadHeaderError(ValueError):
    99    pass
     
    4949        msg['Subject'] = subject
    5050        msg['From'] = from_email
    5151        msg['To'] = ', '.join(recipient_list)
     52        msg['Date'] = rfc822.formatdate()
    5253        try:
    5354            server.sendmail(from_email, recipient_list, msg.as_string())
    5455            num_sent += 1
Back to Top