Opened 12 years ago

Closed 12 years ago

#4835 closed (invalid)

EmailMultiAlternatives doesn't render unicode html well

Reported by: anonymous Owned by: Adrian Holovaty
Component: Core (Mail) Version: master
Severity: Keywords: mail
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


The following code doesn't render the HTML message well

from django.core.mail import EmailMultiAlternatives
from django.template import Context, Template

test_string = u'éàèèèççççaaaa'

t = Template("Here is a string {{ test_string }}.")
c = Context({"test_string": test_string })

message_html = t.render(c)

subject, from_email, to = 'hello', '', ''
text_content = u'Here is a string %s' % test_string
html_content = message_html
msg = EmailMultiAlternatives(subject, text_content, from_email, [to])
msg.attach_alternative(html_content, "text/html")

Text message is OK but the HTML is not

Change History (2)

comment:1 Changed 12 years ago by anonymous

Component: Core frameworkdjango.core.mail

comment:2 Changed 12 years ago by anonymous

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top