Internationalised email subjects

Martin Skou msj at infoserv.dk
Wed Jun 20 07:55:53 EDT 2007


From:
http://docs.python.org/lib/module-email.header.html

 >>> from email.message import Message
 >>> from email.header import Header
 >>> msg = Message()
 >>> h = Header('p\xf6stal', 'iso-8859-1')
 >>> msg['Subject'] = h
 >>> print msg.as_string()
Subject: =?iso-8859-1?q?p=F6stal?=

/Martin



More information about the Python-list mailing list