Trouble with email package

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Tue Jul 24 20:09:06 EDT 2007


En Tue, 24 Jul 2007 05:10:31 -0300, Harel <harelmalka at gmail.com> 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 physik.rwth-aachen.de>
> 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 <http://docs.python.org/lib/module-email.message.html>:

__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