Opened 9 years ago

Closed 9 years ago

#4835 closed (invalid)

EmailMultiAlternatives doesn't render unicode html well

Reported by: anonymous Owned by: adrian
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: UI/UX:


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 9 years ago by anonymous

  • Component changed from Core framework to django.core.mail
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 9 years ago by anonymous

  • Resolution set to invalid
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.
Back to Top