email 8bit encoding

Antoon Pardon antoon.pardon at rece.vub.ac.be
Mon Jul 29 22:52:04 CEST 2013


Op 29-07-13 01:41, rurpy at yahoo.com schreef:
> How, using Python-3.3's email module, do I "flatten" (I think
> that's the right term) a Message object to get utf-8 encoded
> body with the headers:
>   Content-Type: text/plain; charset=UTF-8
>   Content-Transfer-Encoding: 8bit
> when the message payload was set to a python (unicode) string?
>

I am just trying out some things for my self on python 3.2 so
be sure to test this out but you could try the following.

msg.set_charset('utf-8')
msg['Content-Transfer-Encoding'] = '8bit'

-- 
Antoon Pardon



More information about the Python-list mailing list