Mercurial > p > roundup > code
comparison roundup/mailer.py @ 3516:fe75b55fc49d
fix encoding of subject in generated error message [SF#1414465]
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Fri, 27 Jan 2006 02:41:18 +0000 |
| parents | db856d488de0 |
| children | f43424d545a6 |
comparison
equal
deleted
inserted
replaced
| 3515:7015c1961013 | 3516:fe75b55fc49d |
|---|---|
| 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.12 2006-01-20 03:04:14 richard Exp $ | 4 # $Id: mailer.py,v 1.13 2006-01-27 02:41:18 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 |
| 118 | 118 |
| 119 part = writer.startmultipartbody('mixed') | 119 part = writer.startmultipartbody('mixed') |
| 120 part = writer.nextpart() | 120 part = writer.nextpart() |
| 121 part.addheader('Content-Transfer-Encoding', 'quoted-printable') | 121 part.addheader('Content-Transfer-Encoding', 'quoted-printable') |
| 122 body = part.startbody('text/plain; charset=utf-8') | 122 body = part.startbody('text/plain; charset=utf-8') |
| 123 body.write('\n'.join(error)) | 123 body.write(quopri.encodestring ('\n'.join(error))) |
| 124 | 124 |
| 125 # attach the original message to the returned message | 125 # attach the original message to the returned message |
| 126 part = writer.nextpart() | 126 part = writer.nextpart() |
| 127 part.addheader('Content-Disposition', 'attachment') | 127 part.addheader('Content-Disposition', 'attachment') |
| 128 part.addheader('Content-Description', 'Message you sent') | 128 part.addheader('Content-Description', 'Message you sent') |
