CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Loop problems sending JMail E-mail to multiple recipients

Print topic Send  topic

Author Message
mas7357

Posts: 29
Posted: 09/13/2007, 12:13 PM

OK I am beaten.......please help

I am trying to add some basic E-mail functionality to my pages and I am having problems with sending E-mail to multiple people with the following code

Set rs = DBconnection1.Execute("SELECT E_Mail FROM tblSwimmerDetailsConfidential WHERE Membership_Status='Lapsed'")
Do
strEmailAddr = rs("E_Mail")
JMail.ServerAddress = "authsmtp." & strServer & ":25"
JMail.Sender = "info@" & strServer
JMail.Subject = "JMail Example" & " Sent @ " & now()
JMail.AddRecipient = strEmailAddr
JMail.Body = "This test mail sent from: " & strServerIP & " using the JMail component on the server."
JMail.Priority = 3
JMail.AddHeader "Originating-IP", strClientIP
If NOT blnSpam Then JMail.Execute
rs.MoveNext
Loop Until rs.EOF
set jmail=nothing
rs.close
set rs= nothing

I know there are 4 lapsed members in the database (all with the sanme E-mail) but I only get an E-mail sent once (rather than 4 times). I guess there is somenthing wrong with the loop but i cannot fathom it out- can anybody help?
_________________
MikeS
View profile  Send private message
mhope

Posts: 37
Posted: 09/13/2007, 7:38 PM

Not tested but maybe:

Set rs = DBconnection1.Execute("SELECT E_Mail FROM tblSwimmerDetailsConfidential WHERE Membership_Status='Lapsed'")

While NOT rs.EOF
strEmailAddr = rs("E_Mail")
JMail.ServerAddress = "authsmtp." & strServer & ":25"
JMail.Sender = "info@" & strServer
JMail.Subject = "JMail Example" & " Sent @ " & now()
JMail.AddRecipient = strEmailAddr
JMail.Body = "This test mail sent from: " & strServerIP & " using the JMail component on the server."
JMail.Priority = 3
JMail.AddHeader "Originating-IP", strClientIP
If NOT blnSpam Then JMail.Execute
set jmail=nothing

rs.MoveNext
Wend
rs.close
set rs= nothing
View profile  Send private message
mas7357

Posts: 29
Posted: 09/14/2007, 12:32 AM

Thanks for the reply- I am sure I have tried a while wend "loop" and it didn't work either but I will try again

Mike
_________________
MikeS
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.