Adjuntar ficheros en python.

Gerhard Häring gerhard at bigfoot.de
Mon Apr 8 10:56:01 EDT 2002


I won't pretend to be able to *write* Spanish, so I'll answer in
English.

jmanzano at antena3tv.es wrote in comp.lang.python:
> Hola
> 
> Alguien me puede decir como puedo adjuntar ficheros en python a la
> hora de enviar emails.

How do I attach files in Python when sending emails?

If you're using Python >= 2.2, simply use the email module and look
this up in its documentation, which has examples for exactly that.

For Python 2.1, this module is available seperately in the mimelib
project at Sourceforge.

For even older Pythons, you'll have to play some tricks with the
mimetools package yourself. I've seen answers on comp.lang.python for
that, so searching groups.google.com for "email mime attachment"
should give some options.

HTH,

Gerhard
-- 
mail:   gerhard <at> bigfoot <dot> de       registered Linux user #64239
web:    http://www.cs.fhm.edu/~ifw00065/    OpenPGP public key id AD24C930
public key fingerprint: 3FCC 8700 3012 0A9E B0C9  3667 814B 9CAA AD24 C930
reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b')))



More information about the Python-list mailing list