NMIMETools - a replacement for the MIMETools
Download current releases at http://mjablonski.zope.de/NMimeToolsN(ew)MIMETools - a replacement for the MIMEToolsProblem - How to send all of the files in a folder as attachements using sendmail and mime?You cannot create mails with all files of a folder as attachments with the original MIMETools, because you cannot iterate with the in-tag over the original boundary-tag (internally it's a blockContinuations-tag). Solution - Use the NMIMETools-ProductThe NMIMETools will give you two new tags: nmime & nboundary. Both have the same arguments as the original MIMETools-counterparts. The difference between the MIMETools and the NMIMETools is that the nboundary-tag is now a "real-open-and-close-block"-tag: it must be opened and closed! This will give you the chance to iterate with the in-tag over the nboundary-block. (For some compatibilty with the MIME-RFC's and the original MIMETools: Nesting nmime-tags in nmime-tags is possible, but for most problems this need not to be used at all.) Example - Sending all files of a folder as attachmentsHere's an example of how to send all files of a folder: <dtml-sendmail smtphost="127.0.0.1"> To: [email protected] From: [email protected] 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>
|
|
Available Releases
Version | Maturity | Platform | Released |
---|---|---|---|
0.20325 | Stable | 2004-10-03 01:21:57 | |
NMIMETools-0.20325.tgz (8 K) | All |