Skip to content

Commit 9b19d90

Browse files
committed
Fix ascii decoding error
.. when using mailer.standard_message -- we need to pass the configured mail encoding.
1 parent 64b0a28 commit 9b19d90

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

roundup/mailer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,10 @@ def standard_message(self, to, subject, content, author=None):
142142
143143
All strings are assumed to be UTF-8 encoded.
144144
"""
145+
charset = getattr(self.config, 'EMAIL_CHARSET', 'utf-8')
145146
message = self.get_standard_message()
146147
self.set_message_attributes(message, to, subject, author)
147-
message.set_payload(s2u(content))
148+
message.set_payload(s2u(content), charset=charset)
148149
self.smtp_send(to, message.as_string())
149150

150151
def bounce_message(self, bounced_message, to, error,

0 commit comments

Comments
 (0)