adding mail attachments
Grant Edwards
ge at nowhere.none
Fri Jun 23 18:28:53 EDT 2000
In article <8ivdl4$90k$1 at supernews.com>, geoff munday wrote:
>OK, I can send mail via the smtplib but am at a loss as how to
>attach files to the Email. Can anyone advise where to look for
>instructions or examples??
Take a look at <ftp://ftp.visi.com/users/grante/stuff/mfetch.py>.
There's a class called SmtpWriter that has a "Message" method
that probably does what you want...
def Message(self,sender="", subject="", recipients=[], body="", attachments=[]):
if self.__debugLevel > 2:
sys.stderr.write("SmtpWriter: Building RFC822 message From: %s; Subject: %s; (Length=%d with %d attachments)\n" %
(sender, subject, len(body),len(attachments)))
[...]
The MimeWriter library module is where most of the magic
happens...
--
Grant Edwards grante Yow! My nose feels like a
at bad Ronald Reagan movie...
visi.com
More information about the Python-list
mailing list