Decode html parts correctly

This commit is contained in:
Peter J. Holzer 2019-03-01 22:51:06 +01:00
parent 5ee7c066ca
commit 1a0ce4a967
1 changed files with 1 additions and 1 deletions

View File

@ -89,7 +89,7 @@ def render_body(msg):
bodyhtml = bodytmpl.render(context)
elif content_type == "text/html":
htmlpart = HTMLPart()
htmlpart.feed(msg.get_payload())
htmlpart.feed(msg.get_payload(decode=True).decode(msg.get_charset() or "iso-8859-1"))
bodytmpl = jenv.get_template("body_text_html.html")
context = {
"body": jinja2.Markup(htmlpart.as_string())