Re: [WebDNA] multi [sendmail] inside [search]
This WebDNA talk-list message is from 2012
It keeps the original formatting.
numero = 109295
interpreted = N
texte = >=20>>> The problem is, WebDNA doesn't like using a [sendmail]>>> tag inside of a [search...][founditems] routine.>>=20>> Of course it does, I've been doing this for years. What=20>> seems to be the problem that causes you to say this?>=20>=20> The simple problem is that it won't work...> Here's a sample....>=20> [search db=3D../login/website_users.db& code..blah..code...]> [founditems] =20> code..blah..code...> [showif code..blah..code...> [loop start=3D[ code..blah..code...]===09> [text] message =3D> [showif code..blah..code...> [/showif]> [/text]> [/loop]> [/showif] =20> [sendmail =to=3Dtimeclock@domain.com&from=3DWebpage@domain.com&subject=3DStaff Over =40 message (no reply)&content-type=3Dtext/html]> [message]> [/sendmail]> code..blah..code...> [/founditems]> [/search]>=20> But this does work, but with only the last item found....>=20> [search db=3D../login/website_users.db& code..blah..code...]> [founditems] =20> code..blah..code...> [showif code..blah..code...> [loop start=3D[ code..blah..code...]===09> [text] message =3D> [showif code..blah..code...> [/showif]> [/text]> [/loop]> [/showif] =20> code..blah..code...> [/founditems]> [/search]>=20> [sendmail to=3Dtimeclock@domain.com&from=3DWebpage@ =domain.com&subject=3DStaff Over 40 message (no =reply)&content-type=3Dtext/html]> [message]> [/sendmail]Stephen, I also have sent mail using [sendmail] countless times inside a =[search][founditems]...But anyway, as far as the above code (latter example) only sending one =email.. well that makes perfect sense (looking at the code you wrote). =If you want 3 emails to go out, you have to write out 3 [sendmail]'s =...or put the [sendmail] inside a loop that will fire 3 times (like =inside [founditems] ;-) .. or inside [loop], or inside [listwords], or =inside whatever other loop serves you best. If you do not want to debug =why [sendmail] was failing inside [founditems] on your first attempt, =then you could rewrite your latter attempt, like so:[search db=3D../login/website_users.db& code..blah..code...][founditems] =20code..blah..code...[showif code..blah..code...[loop start=3D[code..blah..code...][text]message_[index] =3D[showif =code..blah..code...[/showif][/text]=[text]NumTimesLoopFired=3D[index][/text][!]<--- 1.) this might go here, =or else below---[/!][/loop][/showif] =20code..blah..code...[text]NumTimesLoopFired=3D[index][/text][!]<--- 2.) this =might go here, or else above---[/!][/founditems][/search][loop start=3D1&end=3D[NumTimesLoopFired]&advance=3D1][sendmail to=3Dtimeclock@domain.com&from=3DWebpage@ =domain.com&subject=3DStaff Over 40 message (no =reply)&content-type=3Dtext/html][interpret][message_[index]][/interpret][/sendmail][/loop]
Associated Messages, from the most recent to the oldest:
>=20>>> The problem is, WebDNA doesn't like using a
[sendmail]>>> tag inside of a [search...]
[founditems] routine.>>=20>> Of course it does, I've been doing this for years. What=20>> seems to be the problem that causes you to say this?>=20>=20> The simple problem is that it won't work...> Here's a sample....>=20> [search db=3D../login/website_users.db& code..blah..code...]>
[founditems] =20> code..blah..code...> [showif code..blah..code...> [loop start=3D[ code..blah..code...]===09>
[text] message =3D> [showif code..blah..code...> [/showif]> [/text]> [/loop]> [/showif] =20> [sendmail =to=3Dtimeclock@domain.com&from=3DWebpage@domain.com&subject=3DStaff Over =40 message (no reply)&content-type=3Dtext/html]> [message]> [/sendmail]> code..blah..code...> [/founditems]> [/search]>=20> But this does work, but with only the last item found....>=20> [search db=3D../login/website_users.db& code..blah..code...]>
[founditems] =20> code..blah..code...> [showif code..blah..code...> [loop start=3D[ code..blah..code...]===09>
[text] message =3D> [showif code..blah..code...> [/showif]> [/text]> [/loop]> [/showif] =20> code..blah..code...> [/founditems]> [/search]>=20> [sendmail to=3Dtimeclock@domain.com&from=3DWebpage@ =domain.com&subject=3DStaff Over 40 message (no =reply)&content-type=3Dtext/html]> [message]> [/sendmail]Stephen, I also have sent mail using
[sendmail] countless times inside a =
[search][founditems]...But anyway, as far as the above code (latter example) only sending one =email.. well that makes perfect sense (looking at the code you wrote). =If you want 3 emails to go out, you have to write out 3
[sendmail]'s =...or put the
[sendmail] inside a loop that will fire 3 times (like =inside
[founditems] ;-) .. or inside
[loop], or inside
[listwords], or =inside whatever other loop serves you best. If you do not want to debug =why
[sendmail] was failing inside
[founditems] on your first attempt, =then you could rewrite your latter attempt, like so:[search db=3D../login/website_users.db& code..blah..code...]
[founditems] =20code..blah..code...[showif code..blah..code...[loop start=3D[code..blah..code...]
[text]message_[index] =3D[showif =code..blah..code...[/showif][/text]=
[text]NumTimesLoopFired=3D[index][/text]
[!]<--- 1.) this might go here, =or else below---[/!][/loop][/showif] =20code..blah..code...
[text]NumTimesLoopFired=3D[index][/text]
[!]<--- 2.) this =might go here, or else above---[/!][/founditems][/search][loop start=3D1&end=3D[NumTimesLoopFired]&advance=3D1][sendmail to=3Dtimeclock@domain.com&from=3DWebpage@ =domain.com&subject=3DStaff Over 40 message (no =reply)&content-type=3Dtext/html]
[interpret][message_[index]][/interpret][/sendmail][/loop]
Govinda
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
Upgrading old WebCat Database Files (1997)
BUG in [showif] using ^ (contains) (1997)
[format 40s]text[/format] doesn't work (1997)
quantity minimum problem (1997)
E-Mailer (WebCatb15acgiMac) (1997)
WebCatalog and Webstar 3.02 (1998)
Country & Ship-to address & other fields ? (1997)
[format] (1998)
suffix mapping for NT? (1997)
can WC render sites out? (1997)
Email template names (1997)
Help formatting search results w/ table (1997)
[OT] Bush's Cyberensive (2003)
Unexpected error (1997)
Stumpted Again (1997)
do NOT process webdna tags (2005)
Reminder for beta testers (2000)
Blog solution (2006)
target=_blank and form variables (1997)
Cookie set browser session. (1998)