Thank you Flynt, You have my permission to CC to the list at any time :) I e-mailed to you personally because I saw that you had the same problem I do, and I hoped that way I will get reply sooner. While I was waiting for you I played around and succeed to attach pdf document, but I cannot get right name (instead of name it gives me '-' ). Here is the code that I was using. <dtml-mime type=application/pdf encode=7bit> Attached is the document you requested. <dtml-boundary name=report.pdf type=application/pdf disposition=attachment encode=uuencode filename=report.pdf> <dtml-var expr="restrictedTraverse('report.pdf')"> </dtml-mime> I tried code you sent me and it gives me strange results. I tried testimage.data and got lots of gibberish, and than I tried testimage and got a little gibberish but not the image itself. Did I miss something? Vid --- Flynt <rhess@bic.ch> wrote:
zoops4@yahoo.com wrote:
Hi,
I am trying to send e-mail with attachment using
<dtml-sendmail>. I
noticed you had the same problem earlier, therefore I hope you can give me some suggestions. This is the code that I am using
First try:
<dtml-mime type=text/plain encode=7bit>
<dtml-boundary type=application/octet-stream disposition=attachment encode=base64> <dtml-var "selected_image.read()">
</dtml-mime>
first error:
Error Type: AttributeError Error Value: 'string' object has no attribute 'read'
Second try:
<dtml-mime type=text/plain encode=7bit>
<dtml-boundary type=application/octet-stream disposition=attachment encode=base64> <dtml-var "restrictedTraverse(selected_image).read()">
</dtml-mime>
Second Error:
Error Type: AttributeError Error Value: read
Thank you in ahead of time.
Vid
Hi Vid
(You mailed me personally, but I cc to the list with your permission ;-)
This code is working for me with documents and files (but not with images stored in the ZODB); I tried it with binary, pdf and html content.
<dtml-sendmail mailhost="MailHost"> From: <dtml-var sender> To: <dtml-var recipient> Date: <dtml-var ZopeTime fmt="rfc822"> Subject: Testmessage <dtml-mime type="text/plain" encode="7bit">
testmessage textbody
<dtml-boundary type="application/octet-stream" disposition="attachment" encode="base64" filename="testfile"><dtml-var testfile></dtml-mime> </dtml-sendmail>
Regards
--- Flynt
(Supplement)
Hi Vid
Here is the code, to send an image:
<dtml-sendmail mailhost="MailHost"> From: <dtml-var sender> To: <dtml-var recipient> Date: <dtml-var ZopeTime fmt="rfc822"> Subject: Testmessage <dtml-mime type="text/plain" encode="7bit">
testmessage textbody
<dtml-boundary type="application/octet-stream" disposition="attachment" encode="base64" filename="testimage.jpg"><dtml-var "testimage.data"></dtml-mime> </dtml-sendmail>
Regards
--- Flynt
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists -
http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
__________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail http://personal.mail.yahoo.com/