Mercurial > p > roundup > code
comparison roundup/mailer.py @ 2034:be047db3dd3d
Eudora can't handle utf-8 headers. We love Eudora. [SF#900046]
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Mon, 23 Feb 2004 05:29:06 +0000 |
| parents | fc52d57c6c3e |
| children | 48600089c73d |
comparison
equal
deleted
inserted
replaced
| 2033:d11ba8f375cb | 2034:be047db3dd3d |
|---|---|
| 1 """Sending Roundup-specific mail over SMTP. | 1 """Sending Roundup-specific mail over SMTP. |
| 2 """ | 2 """ |
| 3 __docformat__ = 'restructuredtext' | 3 __docformat__ = 'restructuredtext' |
| 4 # $Id: mailer.py,v 1.5 2004-02-11 23:55:08 richard Exp $ | 4 # $Id: mailer.py,v 1.6 2004-02-23 05:29:05 richard Exp $ |
| 5 | 5 |
| 6 import time, quopri, os, socket, smtplib, re | 6 import time, quopri, os, socket, smtplib, re |
| 7 | 7 |
| 8 from cStringIO import StringIO | 8 from cStringIO import StringIO |
| 9 from MimeWriter import MimeWriter | 9 from MimeWriter import MimeWriter |
| 27 if not author: | 27 if not author: |
| 28 author = straddr((self.config.TRACKER_NAME, | 28 author = straddr((self.config.TRACKER_NAME, |
| 29 self.config.ADMIN_EMAIL)) | 29 self.config.ADMIN_EMAIL)) |
| 30 message = StringIO() | 30 message = StringIO() |
| 31 writer = MimeWriter(message) | 31 writer = MimeWriter(message) |
| 32 writer.addheader('Subject', encode_header(subject)) | 32 writer.addheader('Subject', encode_header(subject, |
| 33 self.config.EMAIL_CHARSET)) | |
| 33 writer.addheader('To', ', '.join(to)) | 34 writer.addheader('To', ', '.join(to)) |
| 34 writer.addheader('From', author) | 35 writer.addheader('From', author) |
| 35 writer.addheader('Date', time.strftime("%a, %d %b %Y %H:%M:%S +0000", | 36 writer.addheader('Date', time.strftime("%a, %d %b %Y %H:%M:%S +0000", |
| 36 time.gmtime())) | 37 time.gmtime())) |
| 37 | 38 |
