[Answered ]-Django template showing raw HTML instead of rendering

1👍

from django.core.mail import EmailMultiAlternatives
subject, from_email, to = 'Subject',settings.EMAIL_HOST_USER, to_address_email
text_content = 'This is an important message.'
html_content = '<div>Your have to right all your content inside in this div even styles should include in this</div>'
msg = EmailMultiAlternatives(subject, text_content, from_email, [to])
msg.attach_alternative(html_content, "text/html")
msg.send()
👤Akram

Leave a comment