Jason Friedman writes:
> I suppose you already figured out that you can call __delitem__() to
> clear the headers and add them back in whatever order you like.
Well, this would mean saving all headers, deleting all, inserting my
own, and adding the saved original headers again. Seems complicate
Hi,
the EmailMessage class of email.message provides the methods
add_header() and __setitem__() to add a header to a message.
add_header() effectively calls __setitem__(), which does
`self._headers.append(self.policy.header_store_parse(name, val))`. This
inserts the header at the bottom.
It is,