-----Original Message----- From: rheal.dugas@can.xerox.com [mailto:rheal.dugas@can.xerox.com] Sent: Wednesday, May 19, 1999 2:55 PM To: zope@zope.org Subject: [Zope] E-Mails
I've setup a sql database similar to a guestbook that customers can fill out.
What I want to be able to do is search for a ceratain field in the database and then e-mails a file (ie PDF) or just a plain text file to all the people that the search found. The e-mail address is in the database.
Can anyone help me out?
This will require a variety of tools, an ZSQL method to return a list of email addresses to be mailed to, which will be iterated in an <!--#in--> tag over a <!--#sendmail--> tag which used the <!~--#mime--> tag to attach your file (untested): <!--#in mySQLQuery--> <!--#sendmail--> To: <!--#var sequence-item--> From: me@here.com <!--#mime encode=7bit type=text/plain--> Here's your file. <!--#boundary encode=base64 type=application/adobe-pdf disposition=attachment--><!--#var "fileobject.read()"--><!--#/mime--> <!--#/sendmail--> <!--#/in--> Note, starting at the boundary tag to the /mime tag it is all one line, otherwise you will introduce unwanted newlines in your mime body which will break it. Also, the mime tag is new in 1.11pr1. Also, I have know idea what the mime type of a pdf file is, I made applcation/adobe-pdf up. -Michel
_______________________________________________ Zope maillist - Zope@zope.org http://www.zope.org/mailman/listinfo/zope
(For developer-specific issues, use the companion list, zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
Also, I have know idea what the mime type of a pdf file is, I made application/adobe-pdf up. To answer this question, I looked at the source of an email with a pdf attachment:
------=_NextPart_000_0083_01BEA20D.470161A0 Content-Type: application/pdf; name="zope2chp1.pdf" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="zope2chp1.pdf" Changes in this code will probably need to be made to match.
<!--#in mySQLQuery--> <!--#sendmail--> To: <!--#var sequence-item--> From: me@here.com <!--#mime encode=7bit type=text/plain--> Here's your file. <!--#boundary encode=base64 type=application/adobe-pdf disposition=attachment--><!--#var "fileobject.read()"--><!--#/mime--> <!--#/sendmail--> <!--#/in-->
-Bob OConnor bob@rocnet.com
Michel Pelletier wrote: <snipped an excellent example>
Note, starting at the boundary tag to the /mime tag it is all one line, otherwise you will introduce unwanted newlines in your mime body which will break it. Also, the mime tag is new in 1.11pr1. Also, I have know idea what the mime type of a pdf file is, I made applcation/adobe-pdf up.
Hmm, according to Edit/Preferences/Navigator/Applications on my copy of Netscape, it's application/pdf, so you're close. -- Ross J. Reedstrom, Ph.D., <reedstrm@rice.edu> NSBRI Research Scientist/Programmer Computer and Information Technology Institute Rice University, 6100 S. Main St., Houston, TX 77005
participants (3)
-
Michel Pelletier -
reedstrmļ¼ wallace.ece.rice.edu -
Robert O'Connor