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 |
 |
 |
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
|
 |
 |
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 |
 |
 |
|