Trying to send email to users in a database - based off of their pilot_level (user level) that can be picked from a database.
I get the form results to transfer a-ok to a confirmation type page. but get lost at that point. I use UltraDev4, so a bit lost on hand coding still. Heres what I have
Thank you in advance
<%
'function to open database
dim sql,con, gvfforce
set con=server.createObject("ADODB.Connection"
set gvfforce = Server.CreateObject("ADODB.Recordset"
con.open connectionString
SQL = "Select Email from tblPilots ORDER BY Pilot_Level"
con.execute sql
set gvfforce = nothing
set con = nothing
Dim emStr
emStr = ""
WHILE not gvfforce.eof and response.isclientconnected()
emStr = emStr & con("Email" & ";"
con.movenext
WEND
con.close
set con = nothing
'function to close database
con.Close()
Dim objMail
Set objMail = Server.CreateObject("JMail.SMTPMail"
objMail.ServerAddress = "smtp.stormhosts.com"
objMail.From = "webmaster@flydetour.com"
objMail.Subject = strSubject
objMail.To = "pilots@flydetour.com"
objMail.BCC = emStr
objMail.Body = strMessage
objMail.Send
Response.write("Mail was Sent"
set objMail = nothing
%>
I get the form results to transfer a-ok to a confirmation type page. but get lost at that point. I use UltraDev4, so a bit lost on hand coding still. Heres what I have
Thank you in advance
<%
'function to open database
dim sql,con, gvfforce
set con=server.createObject("ADODB.Connection"
set gvfforce = Server.CreateObject("ADODB.Recordset"
con.open connectionString
SQL = "Select Email from tblPilots ORDER BY Pilot_Level"
con.execute sql
set gvfforce = nothing
set con = nothing
Dim emStr
emStr = ""
WHILE not gvfforce.eof and response.isclientconnected()
emStr = emStr & con("Email" & ";"
con.movenext
WEND
con.close
set con = nothing
'function to close database
con.Close()
Dim objMail
Set objMail = Server.CreateObject("JMail.SMTPMail"
objMail.ServerAddress = "smtp.stormhosts.com"
objMail.From = "webmaster@flydetour.com"
objMail.Subject = strSubject
objMail.To = "pilots@flydetour.com"
objMail.BCC = emStr
objMail.Body = strMessage
objMail.Send
Response.write("Mail was Sent"
set objMail = nothing
%>