[Zope] Attaching multiple file to mime

Maik Jablonski maik.jablonski@uni-bielefeld.de
Mon, 25 Mar 2002 11:51:38 +0100


hi to all,

some weeks ago Chris Bruce and me asked:

> has anybody got any working example of how to send all of the files
> in a folder as attachments using sendmail and mime?

This will not work with the original MIMETools. So I created a new Product:
N(ew)MIMETools!

http://www.zope.org/Members/mjablonski/NMIMETools

With the NMIME-Product installed you can send all files of a folder for
example like this:

<dtml-sendmail smtphost="127.0.0.1">  
To: yourMailAccount@yourMailServer.yourMailDomain 
From: zope@yourZopeServer.yourZopeDomain  
Subject: NMIME-Example with multiple attachments  
<dtml-nmime type="text/plain" encode="7bit">

Just a demonstration how to send multiple attachments with 
the NMIMETOOLS.

<dtml-in "objectValues('File')"><dtml-nboundary type_expr="content_type"
disposition="attachment" encode="base64"
filename_expr="_['sequence-item'].getId()"><dtml-var
sequence-item></dtml-nboundary></dtml-in></dtml-nmime>
</dtml-sendmail>

Please note: the NMIMETools have the same arguments as the original MIMETools.
The only difference: <dtml-nboundary>-tag is now a real-block-tag (with an
open & close-statement) which allows iterating!

Maybe someone will find this helpful for his work. Bug reports and comments
are welcome...

greetings, maik.

-- 
 maik jablonski                           visit www.zope.org,
 universitaet bielefeld                   LET'S GET ZOPED!!!!
 zentrum fuer lehrerbildung                                 
 didaktik des sachunterrichts                            
 postfach 10 01 31                                          
 33501 bielefeld 		    
 germany                                                    
 tel: + 49 (0) 521 106 4234                                 

 http://www.zfl.uni-bielefeld.de/
 http://www.sachunterricht-online.de/