msg = EmailMessage(subject, body, from_email, [to_email]) msg.content_subtype = "html" msg.send()
如何添加“回复”标题?
ctehm74n1#
您需要向EmailMessage添加一个Reply-To头文件。
EmailMessage
Reply-To
headers = {'Reply-To': reply_email} msg = EmailMessage(subject, body, from_email, [to_email], headers=headers) msg.content_subtype = "html" msg.send()
zpgglvta2#
从Django 1.8开始,有一个参数可以传递给EmailMessage的构造函数,名为reply_to,它将为您处理头文件逻辑。
reply_to
2条答案
按热度按时间ctehm74n1#
您需要向
EmailMessage
添加一个Reply-To
头文件。zpgglvta2#
从Django 1.8开始,有一个参数可以传递给
EmailMessage
的构造函数,名为reply_to
,它将为您处理头文件逻辑。