try something like the following (UNTESTED) code:

from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText
from email.Message import Message

  def attch_send(self):
       msg = MIMEMultipart()
       #msg.add_header("From", sender)
       #msg.add_header("To", recv)

       msg.attach(MIMEText('file(s) attached')) # the body text

       attachment = Message()
       attachment.add_header('Content-type', 'text/plain',
                                          name="web-list.txt")
       attachment.add_header('Content-Disposition', 'attachment',
                                          filename="web-list.txt")
       
attachment.set_payload(file(os.path.join(save_dir,"web-list.txt")).read())
       msg.attach(attachment)

       server = smtplib.SMTP('localhost')
       #server.set_debuglevel(1)
       server.sendmail(sender, recv, msg.as_string())
       server.quit()
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to