Re: [Zope] Sendmail examples
steve smith wrote: Anyone have any good, real-world examples using DTML-Sendmail tags? Would especially appreciate examples integrating SQL queries. Ta! Steve ___ Zope maillist - [EMAIL PROTECTED] 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 ) Hello, I've an example here. I'm using sql to find and check passwd/user. If this sql_check_passwd is true, i'll find in another table, the user's e_mail. Then i'll send an e-mail for him. Here is: dtml-in sql_check_passwd dtml-in sql_find_e_mail dtml-if "code == _['sequence-item'].code_table" dtml-sendmail mailhost=MailHost to: dtml-var e_mail from: [EMAIL PROTECTED] subject: dtml-var subject - here, you put the message /dtml-sendmail scriptalert("Your message was send successfully")/script br /dtml-if cod_pesq /dtml-in sql_find_e_email dtml-else scriptalert("User/Passwd incorrect.")/script /dtml-in sql_check_passwd []'s Marcus Mendes ___ Zope maillist - [EMAIL PROTECTED] 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 )
Re: [Zope] Sendmail examples
Here's on I particularly like, sorry it doesn't have a sql query. It sends an attached image file, contents and all, not just an IMG SRC reference. And do youself a favour by adding a Mailhost object somewhere above where you want to use it. dtml-sendmail mailhost="MailHost" To: Feedback Recipient [EMAIL PROTECTED] From: Zope Feedback Form [EMAIL PROTECTED] Subject: Feedback from the web Feedback from : Matt Comments: dtml-var some_text dtml-mime type=image/jpeg encode=base64 name=paris.jpgdtml-var "paris.data" /dtml-mime /dtml-sendmail Matt steve smith wrote: Anyone have any good, real-world examples using DTML-Sendmail tags? Would especially appreciate examples integrating SQL queries. Ta! Steve ___ Zope maillist - [EMAIL PROTECTED] 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 ) ___ Zope maillist - [EMAIL PROTECTED] 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 )
Re: [Zope] Sendmail examples
At 10:01 pm +1000 22/1/01, steve smith wrote: Anyone have any good, real-world examples using DTML-Sendmail tags? Would especially appreciate examples integrating SQL queries. Ta! Steve What, you mean including ones that send mail into the future? :) (couldn't resist). Assuming you've set up a MailHost object called 'MailHost' Set up a FORM with variables: recipient, name and comments and make the ACTION URL the following piece of DTML (with appropriate sugar around it) !--#sendmail mailhost="MailHost"-- To: Feedback Recipient !--#var recipient-- From: Zope Feedback Form zope_form@thoth Subject: Feedback from the web Feedback from : !--#var name-- Comments: !--#var comments-- !--#/sendmail-- hth tone -- Dr Tony McDonald, FMCC, Networked Learning Environments Project http://nle.ncl.ac.uk/ The Medical School, Newcastle University Tel: +44 191 222 5116 A Zope list for UK HE/FE http://www.fmcc.org.uk/mailman/listinfo/zope ___ Zope maillist - [EMAIL PROTECTED] 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 )
RE: [Zope] Sendmail examples
Hi Tony, Thanks for taking the time to answer. The "MailHost" object seems to be the key. I tried going around it (using the SMTPHost attribute, from memory), without much luck. Also learnt that one needs at least modest knowledge of SMTP syntax when forming the option lines! Thanks again, Steve -Original Message- From: Tony McDonald [mailto:[EMAIL PROTECTED]] Sent: Tuesday, 24 October 2000 8:35 To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [Zope] Sendmail examples At 10:01 pm +1000 22/1/01, steve smith wrote: Anyone have any good, real-world examples using DTML-Sendmail tags? Would especially appreciate examples integrating SQL queries. Ta! Steve What, you mean including ones that send mail into the future? :) (couldn't resist). Assuming you've set up a MailHost object called 'MailHost' Set up a FORM with variables: recipient, name and comments and make the ACTION URL the following piece of DTML (with appropriate sugar around it) !--#sendmail mailhost="MailHost"-- To: Feedback Recipient !--#var recipient-- From: Zope Feedback Form zope_form@thoth Subject: Feedback from the web Feedback from : !--#var name-- Comments: !--#var comments-- !--#/sendmail-- hth tone -- Dr Tony McDonald, FMCC, Networked Learning Environments Project http://nle.ncl.ac.uk/ The Medical School, Newcastle University Tel: +44 191 222 5116 A Zope list for UK HE/FE http://www.fmcc.org.uk/mailman/listinfo/zope ___ Zope maillist - [EMAIL PROTECTED] 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 )
Re: [Zope] Sendmail examples
steve smith wrote: Anyone have any good, real-world examples using DTML-Sendmail tags? Would especially appreciate examples integrating SQL queries. hi steve. one of the worst things with zope sendmail is that you cannot indent things the way you might with clean coding use. but, you can use some very nice sql calls within you sendmail, including appropriate indentation. below is a sendmail method that i use to read a string of email address from a mysql database, and the text of the email from a second database, which gets parsed via an external python script (to parse the string of text into lines of = 75 chars, otherwise the text gets sent as single lines). also, it checks for non-existent email addresses or missing names (the database is a list of people and companies, whether connected to the net or not). it may not be the most efficient, but it works; and any suggestions as to making it more efficient will be most appreciated. ciao! greg. venaca.com ** clip dtml-var standard_html_header p dtml-in get_group dtml-call "REQUEST.set('counter',2)" dtml-let resp_num=sequence-item resp_x=sequence-index dtml-call "REQUEST.set('counter',resp_x)" dtml-call "REQUEST.set('resp_numx',resp_num)" dtml-if "resp_numx ''" dtml-let resp_ct=sequence-item resp_y=sequence-index dtml-if "resp_y == counter" dtml-in get_prs dtml-call "REQUEST.set('pr_num', strip_blank(pr_id)[:-1])" dtml-if "pr_num == selection" dtml-call "REQUEST.set('z_subject', pr_subject)" dtml-call "REQUEST.set('z_title',title)" dtml-call "REQUEST.set('msg',pr_content)" dtml-if "primary_email '' and primary_name ''" dtml-sendmail mailhost="MailHost" To: dtml-var primary_name dtml-var primary_email From: [EMAIL PROTECTED] Subject: dtml-var z_subject dtml-var z_title dtml-in "clean_content(msg)" dtml-var sequence-item /dtml-in /dtml-sendmail dtml-elif "primary_name == ''" dtml-sendmail mailhost="MailHost" To: dtml-var primary_email From: [EMAIL PROTECTED] Subject: dtml-var z_subject dtml-var z_title dtml-in "clean_content(msg)" dtml-var sequence-item /dtml-in /dtml-sendmail /dtml-if /dtml-if /dtml-in /dtml-if /dtml-let /dtml-if /dtml-let /dtml-in dtml-var standard_html_footer ___ Zope maillist - [EMAIL PROTECTED] 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 )
[Zope] Sendmail examples
Anyone have any good, real-world examples using DTML-Sendmail tags? Would especially appreciate examples integrating SQL queries. Ta! Steve ___ Zope maillist - [EMAIL PROTECTED] 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 )
Re: [Zope] Sendmail examples
Hey Steve, Don't have any examples with SQL (although, in theory it is just a call to some data and is treated the same as any other data) but take a look at this. http://www.zope.org/Members/BwanaZulia/tell_a_friend/ Cheers, J At 10:01 PM +1000 1/22/2001, steve smith wrote: Anyone have any good, real-world examples using DTML-Sendmail tags? Would especially appreciate examples integrating SQL queries. Ta! Steve ___ Zope maillist - [EMAIL PROTECTED] 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 ) ___ Zope maillist - [EMAIL PROTECTED] 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 )