[Zope] [ANN] NMIMETools 1.0 released

Maik Jablonski maik.jablonski at uni-bielefeld.de
Sun Oct 3 04:31:37 EDT 2004


Hi,

I've just released NMIMETools 1.0 - a multiple-dynamic-attachment-aware 
replacement for the Zope MIMETools. I've released a first version of 
NMIMETools some years ago, which wasn't thread-safe. I've fixed this and 
cleaned up the code, so NMIMETools can be used in 
heavy-duty-environments without problems. At least I think so...;)

Download NMIMETools: http://mjablonski.zope.de/NMimeTools

What is the use of NMIMETools?
------------------------------

If you want to create a mail with multiple dynamically determined 
attachments with the default MIMETools 
(<dtml-sendmail><dtml-mime><dtml-boundary>), you can't do this. No 
chance to iterate over the <dtml-boundary>-tag in a <dtml-in>.

NMIMETools fixes this problem and allows you to attach multiple 
dynamically determind attachments to one mail. It introduces two new 
tags <dtml-nmime> and <dtml-nboundary> to avoid backward compatibility 
issues with MIMETools, because <dtml-nboundary> is now a open/close-tag.

Simple example:

This script iterates over all files in a folder and send them as 
attachments to one mail:

<dtml-sendmail smtphost="127.0.0.1">
To: yourMailAccount at yourMailServer.yourMailDomain
From: zope at 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>

Maybe you'll find it useful...:)

Be zoped, Maik



More information about the Zope mailing list