MIME text attachment question

Gabriel Genellina gagsl-py at yahoo.com.ar
Fri Jan 26 01:31:30 CET 2007

At Thursday 25/1/2007 08:41, Neal Becker wrote:

>I want to send a file (plain text) as an attachment.
>I'm using MIMEText.  This attaches text OK, but I would like to have a
>filename attached to it, so that the recipient could save it without having
>to specify a filename.

part = MIMEText("Hello world!")
part.add_header('Content-Disposition', 'attachment', filename='x.txt')

Gabriel Genellina
Softlab SRL 


Preguntá. Respondé. Descubrí. 
Todo lo que querías saber, y lo que ni imaginabas, 
está en Yahoo! Respuestas (Beta). 
¡Probalo ya! 

More information about the Python-list mailing list