How to add a "Reply" to this in Django?

msg = EmailMessage(subject, body, from_email, [to_email])
msg.content_subtype = "html"
msg.send()

How to add the header "reply to"?

+5
source share
2 answers

You need to add a title Reply-Toto EmailMessage.

headers = {'Reply-To': reply_email}
msg = EmailMessage(subject, body, from_email, [to_email], headers=headers)
msg.content_subtype = "html"
msg.send()
+16
source

According to Django 1.8, there is an argument that can be passed to a constructor EmailMessagewith a name reply_tothat will handle the header logic for you.

+5
source

All Articles