This code is supposed to work but doesnt all I get is cannot relay.
My mail server is set up ok ,its just that when i connect to a database i get the error.
If i just send one email it goes ok.
What i want is another way to update the mail.AddBcc field with data from a data base some type of loop I guess.
<%
strHost = "a valid smtp host.com"
%>
<%
strDbPath = Server.MapPath("." & "\users.mdb"
ConnectStr = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & strDbPath
Set rs = Server.CreateObject("adodb.recordset"
rs.Open "users", ConnectStr, 2, 3
If Request("Send" <> "" Then
Set Mail = Server.CreateObjec("Persits.MailSender"
Mail.Host = strHost
Mail.From = "myemail@myemail.com"
Mail.FromName = "AspEmail Demo"
Mail.Subject = Request("Subject"
Mail.Body = Request("Body"
BCC field
While not rs.EOF
Mail.AddBcc rs("email"
rs.MoveNext
Wend
Mail.Send
Response.Write "Success!"
Else
Response.Write "<B>Currently in the user database:</B><P>"
While not rs.EOF
Response.Write rs("name" & " (" & rs("email" & "<BR>"
rs.MoveNext
Wend
End If
%>
My mail server is set up ok ,its just that when i connect to a database i get the error.
If i just send one email it goes ok.
What i want is another way to update the mail.AddBcc field with data from a data base some type of loop I guess.
<%
strHost = "a valid smtp host.com"
%>
<%
strDbPath = Server.MapPath("." & "\users.mdb"
ConnectStr = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & strDbPath
Set rs = Server.CreateObject("adodb.recordset"
rs.Open "users", ConnectStr, 2, 3
If Request("Send" <> "" Then
Set Mail = Server.CreateObjec("Persits.MailSender"
Mail.Host = strHost
Mail.From = "myemail@myemail.com"
Mail.FromName = "AspEmail Demo"
Mail.Subject = Request("Subject"
Mail.Body = Request("Body"
BCC field
While not rs.EOF
Mail.AddBcc rs("email"
rs.MoveNext
Wend
Mail.Send
Response.Write "Success!"
Else
Response.Write "<B>Currently in the user database:</B><P>"
While not rs.EOF
Response.Write rs("name" & " (" & rs("email" & "<BR>"
rs.MoveNext
Wend
End If
%>