Get ready for BLACK FRIDAY shopping starting in

Forums

This topic is locked

curse of the jmail - emailing group

Posted 27 Mar 2002 00:33:17
1
has voted
27 Mar 2002 00:33:17 Stuart Chase posted:
i've been bouncing all around the answer I think. using JMAIL, i'm trying to make a webpage where someone can pick a user or pilot level like pilot or MOD, and type subject, message, and importance level. then click send and it sends to every registered user who matches that criteria.

heres what I have, but I get all different types of errors, the latest is it didnt like sendmail.

+++++++++++++++++++++++
<%

Dim strFrom
Dim strSubject
Dim strMessage


strSubject = Request.Form("fldSubject"
strMessage = Request.Form("fldMessage"
strFrom = Request.Form("fldFrom"
%>
<%
Dim Jmail
Dim oRS, sDSN, sBody, sSubject, iPriority, sTo

Set JMail = Server.CreateObject("JMail.SMTPMail"

JMail.ServerAddress = "smtp.stormhosts.com"
JMail.ContentType = "text/html"
JMail.Sender = " "

sSubject = strSubject
sBody = strMessage
'iPriority = request("fldImportance"

Set oRS = server.CreateObject("adodb.recordset"


sDSN = "DSN=gvfforce;"


oRS.Open "SELECT * FROM tblPilots WHERE pilot_level = strRecipient", sDSN
Do While Not oRS.EOF
sTo = oRS ("Email"

SendMail sSubject, sBody, sTo,iPriority
oRS.MoveNext
Loop


oRS.Close
Set oRS = nothing
Set Jmail = nothing
On Error Resume Next
If Err <> 0 Then
Response.Write "An error occurred. <br>"
Response.Write "Error: " & err.number & "<br>"
Response.Write "Error: " & err.description & "<br>"
End If
Response.Redirect "sendemail.asp"
%>

Reply to this topic