[Zope] Sending e-mail attachments through a python script

complaw@hal-pc.org complaw@hal-pc.org
Tue, 16 Apr 2002 18:21:39 GMT


Below is a sample python script courtesy of runyaga...
______
try:
  mailhost=getattr(context, context.superValues('Mail Host')[0].id)
except:
  raise AttributeError, "cant find a Mail Host object"

mMsg = 'a testful email message \n that contains a few line breaks. \n ~runyaga'
mTo = 'runyaga@abc.com'
mFrom = 'runyaga@xyz.com'
mSubj = 'mail subject'

mailhost.send(mMsg, mTo, mFrom, mSubj)
______

Has anyone been able to modify the above script so that e-mail attachments could
be sent?  As far as I can tell, the mailhost.send call doesn't accept e-mail
attachments.  However, the DTML sendmail does accept attachments.  

The code that I currently use does not use DTML (it uses a python script).  Must
I use DTML if I want to send e-mail attachments?

Thanks in advance,

Ron