Mercurial > p > roundup > code
comparison roundup/mailer.py @ 1803:ee33ce4987f5
Let standard_message accept a different author.
| author | Johannes Gijsbers <jlgijsbers@users.sourceforge.net> |
|---|---|
| date | Mon, 08 Sep 2003 21:08:59 +0000 |
| parents | 071ea6fc803f |
| children | 4ac11e7fa11a |
comparison
equal
deleted
inserted
replaced
| 1802:fe9d122f1bb1 | 1803:ee33ce4987f5 |
|---|---|
| 1 """Sending Roundup-specific mail over SMTP.""" | 1 """Sending Roundup-specific mail over SMTP.""" |
| 2 # $Id: mailer.py,v 1.1 2003-09-08 09:28:28 jlgijsbers Exp $ | 2 # $Id: mailer.py,v 1.2 2003-09-08 21:08:59 jlgijsbers Exp $ |
| 3 | 3 |
| 4 import time, quopri, os, socket, smtplib, re | 4 import time, quopri, os, socket, smtplib, re |
| 5 | 5 |
| 6 from cStringIO import StringIO | 6 from cStringIO import StringIO |
| 7 from MimeWriter import MimeWriter | 7 from MimeWriter import MimeWriter |
| 39 | 39 |
| 40 writer.addheader('MIME-Version', '1.0') | 40 writer.addheader('MIME-Version', '1.0') |
| 41 | 41 |
| 42 return message, writer | 42 return message, writer |
| 43 | 43 |
| 44 def standard_message(self, to, subject, content): | 44 def standard_message(self, to, subject, content, author=None): |
| 45 message, writer = self.get_standard_message(to, subject) | 45 message, writer = self.get_standard_message(to, subject, author) |
| 46 | 46 |
| 47 writer.addheader('Content-Transfer-Encoding', 'quoted-printable') | 47 writer.addheader('Content-Transfer-Encoding', 'quoted-printable') |
| 48 body = writer.startbody('text/plain; charset=utf-8') | 48 body = writer.startbody('text/plain; charset=utf-8') |
| 49 content = StringIO(content) | 49 content = StringIO(content) |
| 50 quopri.encode(content, body, 0) | 50 quopri.encode(content, body, 0) |
