Django -- 发送HTML格式的邮件

 

提前在setting中设置邮箱server

 

from django.core.mai import EmailMessage
subject, from_email, to
= 'xxx', 'noreplay.com', ['xxx'] html_content = "<p>This is an <font size=3 color='green'><strong>important</strong></font> message.</p>" msg = EmailMessage(subject, msg1, from_email, ['xxx']) msg.content_subtype = 'html' msg.send()

 

posted @ 2018-11-13 10:18  MAU  阅读(996)  评论(0编辑  收藏  举报