Mercurial > p > roundup > code
diff roundup/mailer.py @ 4114:da682f38bad3
bug introduced in the migration to the email package (issue 2550531)
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Tue, 17 Mar 2009 22:56:38 +0000 |
| parents | 4b0ddce43d08 |
| children | 391fa482f995 |
line wrap: on
line diff
--- a/roundup/mailer.py Mon Mar 16 18:04:44 2009 +0000 +++ b/roundup/mailer.py Tue Mar 17 22:56:38 2009 +0000 @@ -23,6 +23,7 @@ orig = msg.get_payload() encdata = quopri.encodestring(orig) msg.set_payload(encdata) + del msg['Content-Transfer-Encoding'] msg['Content-Transfer-Encoding'] = 'quoted-printable' class Mailer: @@ -55,7 +56,7 @@ Subject and author are encoded using the EMAIL_CHARSET from the config (default UTF-8). - Returns a Message object and body part writer. + Returns a Message object. ''' # encode header values if they need to be charset = getattr(self.config, 'EMAIL_CHARSET', 'utf-8') @@ -70,8 +71,8 @@ message = MIMEMultipart() else: message = Message() + message.set_type('text/plain') message.set_charset(charset) - message['Content-Type'] = 'text/plain; charset="%s"'%charset try: message['Subject'] = subject.encode('ascii') @@ -115,6 +116,7 @@ """ message = self.get_standard_message(to, subject, author) message.set_payload(content) + encode_quopri(message) self.smtp_send(to, str(message)) def bounce_message(self, bounced_message, to, error,
