Skip to content

Commit

Permalink
Fixed #2991: Added Message-ID header to messages sent from Django. Th…
Browse files Browse the repository at this point in the history
…anks, Graham King.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@4051 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
jacobian committed Nov 7, 2006
1 parent b1b4e8e commit 6f164ad
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions django/core/mail.py
Expand Up @@ -4,6 +4,9 @@
from email.MIMEText import MIMEText
from email.Header import Header
import smtplib, rfc822
import socket
import time
import random

class BadHeaderError(ValueError):
pass
Expand Down Expand Up @@ -50,6 +53,7 @@ def send_mass_mail(datatuple, fail_silently=False, auth_user=settings.EMAIL_HOST
msg['From'] = from_email
msg['To'] = ', '.join(recipient_list)
msg['Date'] = rfc822.formatdate()
msg['Message-ID'] = "<%d.%d@%s>" % ( time.time(), random.getrandbits(64), socket.getfqdn() )
try:
server.sendmail(from_email, recipient_list, msg.as_string())
num_sent += 1
Expand Down

0 comments on commit 6f164ad

Please sign in to comment.