Django HTML E-mail template doesn't load css in the e-mail

后端 未结 3 1185
情深已故
情深已故 2021-02-13 15:42

I am sending HTML E-mail from Django like this:

template_html = \"email/deposit_email.html\"
                email_context = Context({ \'contact\': contact, \'am         


        
3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-13 16:31

    I am writing this for other people who might run into the same problem like me in the future. Apparently as Mr. Leonardo as pointed out, HTML e-mails doesn't read the external or even internal css at all because the head part of the template are opted out and only body part are used. Thus the solution is to use table and html attributes with inline css to style the html email template.

    Thanks

提交回复
热议问题