Sending email in utf-8?

Fredrik Lundh fredrik at
Tue Nov 8 13:40:25 CET 2005

"morphex" <morphex at> wrote:

> """
> Date: Mon, 7 Nov 2005 11:38:29 -0700 (MST)
> Message-Id: <200511071838.jA7IcTKR095057 at>
> To: morten at, morten at
> From: morten at
> Subject:  Order confirmation
> Content-Type: text/plain; charset="utf-8"
> X-Bogosity: No, tests=bogofilter, spamicity=0.000000, version=0.92.8
> Thank you for your order, it is copied here for your convenience, and
> we will process it shortly.
> Name:  ø
> Phone: ø
> Email:  morten at
> Comments:  asdf
> """

that's 0xC3 0xB8 (at least according to my mail reader), which, translated
back from UTF-8, looks like a typically norsk character to me...

>>> name = "\xc3\xb8".decode("utf-8")

>>> print name

>>> import unicodedata

try adding a "Mime-Version: 1.0" header to your mail.

a "Content-Transfer-Encoding: 8bit" might not hurt either (or run the body through
quopri.encodestring() after you've encoded it, and use "Content-Transfer-Encoding:

(also check the email package: )


More information about the Python-list mailing list