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:
WebCat 3 & Aliases (2000)
[isfile] ? (1997)
problem: mail changed (1997)
Some Questions (1997)
WebCat2b12--[searchstring] bug (1997)
Configuring E-mail (1997)
FEW QUESTIONS (1997)
Cart questions (1997)
Date search bug (1997)
Finding max value for a field (1997)
Browser Resolution (1999)
UPS Shipping Docs (Where To Go) (1999)
breaking words (1997)
form population (1998)
many-to-one problem (1998)
SetHeader (1997)
DON'T use old cart file! (1997)
PCS Frames (1997)
Referrer field to header field conversion (1997)
How To question on setting up downloads (1997)