My Python application uses email.header.Header (http://docs.python.org/2/library/email.header.html ) to encode all headers of outgoing email (including From header), just like indicated here: Encoding mail subject (SMTP) in Python with non-ASCII characters
It works perfectly for ASCII sender names, but for senders like
Adrian Płonka <pokemon@myservice.com>
it produces
From: =?utf-8?q?Adrian_P=C5=82onka_=3Cpokemon=40myservice=2Ecom=3E?=
Unfortunately, Gmail apparently doesn't like this way of encoding as it displays the sender as (unknown) and marks the whole message as Spam.
How do I properly encode non-ASCII senders?