[Python-de] Re: email mit attachement
Gerhard Häring
gerhard.haering at opus-gmbh.net
Thu Dec 12 09:40:17 EST 2002
Uwe Hentzschel wrote:
> On Thu, 12 Dec 2002, Josef Cihal wrote:
>> Wie kann man bitte aus Python beim E-Mailen eine Attachement an
>> einen Email anschliessen und versebden?
>
> So könnte es funktionieren !
> [...]
> import sys
> import base64
> [...]
> from smtplib import SMTP
> from MimeWriter import MimeWriter
> try:
> from cStringIO import StringIO
> except ImportError:
> from StringIO import StringIO
Dafür gibt's heutzutage das email-Modul (bzw. http://mimelib.sf.net/ für die
Python 2.1-User).
In der Python-Doku (http://www.python.org/doc/current/lib/node396.html) sind
auch ein paar gute Beispiele zum Erzeugen von MIME-Messages mit Attachments.
--
Gerhard Häring
OPUS GmbH München
Tel.: +49 89 - 889 49 7 - 32
http://www.opus-gmbh.net/
More information about the Python-de
mailing list