Trouble with email package

Gabriel Genellina gagsl-py2 at
Wed Jul 25 02:09:06 CEST 2007

En Tue, 24 Jul 2007 05:10:31 -0300, Harel <harelmalka at> escribió:

> What was the solution you found?
> Could you please post it? I'm having the same problem... ;o(
> On Jul 16, 2:53 pm, Torsten Bronger <bron... at>
> wrote:
>> > The Content-Transfer-Encoding is wrong.  Okay (well, not okay but)
>> > then I added message["Content-Transfer-Encoding"] = "8bit" to my
>> > code and got
>> >     Content-Type: text/plain; charset="utf-8"
>> >     MIME-Version: 1.0
>> >     Content-Transfer-Encoding: base64
>> >     Content-Transfer-Encoding: 8bit

In case he's not reading anymore, this is an extract from the Message  
class documentation <>:

__setitem__(name, val): Add a header to the message [...] Note that this  
does not overwrite or delete any existing header with the same name. If  
you want to ensure that the new header is the only one present in the  
message with field name name, delete the field first, e.g.:

del msg['subject']
msg['subject'] = 'Python roolz!'

See also the add_header and replace_header methods.

Gabriel Genellina

More information about the Python-list mailing list