Help - email library not working as expected
deathstar at altern.org
Thu Jun 17 14:18:14 CEST 2004
I'm having some problems using the Python email library. I want to write a mail
that has a body, and an attachment with it. From what I understand, the
set_payload() function would be specify the body, and attach() would specify a
MIME attachment Message.
However this does not work. I get an error saying :
'str' object has no attribute 'append'
I'm doing this with Python 2.3.2 on Windows XP SP1. What am I doing wrong here?
How do u specify the body and the attachment to the mail?
======== Code Snippet Start ========
my_mail.set_payload(bdy.read()) #Body of the mail
attachment.set_payload(att.read()) #The attachment
======== Code Snippet End ========
More information about the Python-list