[Zope] need help on mail attachment using dtml

Dieter Maurer dieter@handshake.de
Wed, 18 Apr 2001 21:23:39 +0200 (CEST)


Kam Nejad writes:
 > ... Mime attachment problem ...
 > <dtml-boundary type="application/octet-stream"
 > filename="REQUEST['elvis'].getId() encode=base64>...
You forgot a '"' and "filename" does not accept an expression
but only a literal, use "filename_expr" instead.
Furthermore, though not impossible, it is unlikely that
"REQUEST['elvis']" contains an object with a "getId" method.
Let's assume it is a file object you just downloaded.

Thus:

  <dtml-boundary type="application/octet-stream"
       filename_expr="elvis.filename"
       encode=base64
       ><dtml-var "elvis.read()"
  ></dtml-mime>
  </dtml-sendmail>

may work.


Dieter