Ticket #2991: django-mail-message-id.diff
File django-mail-message-id.diff, 703 bytes (added by , 18 years ago) |
---|
-
mail.py
4 4 from email.MIMEText import MIMEText 5 5 from email.Header import Header 6 6 import smtplib, rfc822 7 import socket 8 import time 9 import random 7 10 8 11 class BadHeaderError(ValueError): 9 12 pass … … 50 53 msg['From'] = from_email 51 54 msg['To'] = ', '.join(recipient_list) 52 55 msg['Date'] = rfc822.formatdate() 56 msg['Message-ID'] = "<%d.%d@%s>" % ( time.time(), random.getrandbits(64), socket.getfqdn() ) 53 57 try: 54 58 server.sendmail(from_email, recipient_list, msg.as_string()) 55 59 num_sent += 1