I'm currently trying to replace a bit of DTML with a Python script. Here's what I currently have:
<dtml-sendmail mailhost="outboundserver"> To: <dtml-var recipientemail> From: <dtml-var senderemail> Subject: <dtml-var subject> <dtml-mime type="text/plain" encode="7bit">
Attention <dtml-var recipientname>:
This file was sent to you from the Foo Company web site.
The sender included this message:
<dtml-boundary type="application/octet-stream" disposition="attachment" encode="base64" filename_expr="filename"><dtml-var expr="publicstore.download(filename=filename,password=password,skipctypeheader=1)"></dtml-mime> </dtml-sendmail>
Basically, it fetches a file from a public download directory, encodes it as a MIME attachment, and sends the works to the specified recipient. Now, the documentation on sending a normal text email is easy enough to find, but from Googling around for more advanced docs it seems like I'm the only person to ever want to do this. Are there any examples for this sort of thing lying around that I somehow managed not to find?
The Zope online help will provide the API for using the MailHost to send messages. So your problem is composing a message in Python?
Look at the Python 'email' package: http://python.org/doc/lib/module-email.html
Specificially the "Generating MIME documents" section. It's probably more useful than DTML.
You'll need to use External Methods to use this module, or allow access to it so that you can use Python Scripts.
Zope maillist - Zope@zope.org
** No cross posts or HTML encoding! **
(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce