How to send an email with an attached file ?

Bernard Delmée bdelmee at advalvas.REMOVEME.be
Wed Jun 25 16:45:38 EDT 2003


> I then tried the example using MIMEMultipart given at
> http://www.python.org/dev/doc/devel//lib/email-mime.txt
> but this example does not run on my system (Python 2.2.1 on Linux)

The email module should be included in 2.2
The CookBook has an example of encoding and bundling attachments:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/86674
and decoding is also explained:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/86676

For older python versions, the following snippet might get you going:
http://sourceforge.net/snippet/detail.php?type=snippet&id=100444







More information about the Python-list mailing list