MYMESSAGE = "<div>Hello</div><p></p>Hello"
send_mail("testing",MYMESSAGE,"noreply@mydomain.com",['assdf@gmail.com'],fail_silently=False)
但是,此消息在发送时不会获取HTML mime类型。在我的展望中,我看到了代码......
答案 0 :(得分:5)
来自the docs:
msg = EmailMessage(subject, html_content, from_email, [to])
msg.content_subtype = "html" # Main content is now text/html
msg.send()
您只能更改它看起来的mimetype的子类型。所以它永远是
"text/%s" % msg.content_subtype