CDONTS Problem - no error msg

J

Janet

I verified that CDONTS and SMTP are supported by the server. I do not
receive an error message when I open the following ASP page nor do I
receive an email. I used response.write to verify that it creates a
recordset. As always, any help is appreciated. Code is as follows:

<!-- #INCLUDE FILE="adovbs.inc" -->
<%

Dim objNewMail ' Our CDO object
Dim strTo ' Strings to hold our email fields
Dim strFrom
Dim strSubject
Dim strBody
Dim objConn


strFrom = "(e-mail address removed)"
strSubject = "!! Alert: Resource Brokering Request Expiration !!"

Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionTimeout = 15
objConn.CommandTimeout = 30

Dim strConnString

strConnString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & _
Server.MapPath("includes\database.mdb") & ";"
strSQL = "SELECT RECRUITER_EMAIL, JOB_FILE_NBR FROM RB_REQUEST WHERE
EXPIR_DT=#" & Date()+1 & "#"


Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open strSQL, strConnString, adOpenKeyset, adLockPessimistic,
adCmdText



Do While Not RS.EOF
strTo = RS.Fields("RECRUITER_EMAIL")
strJob = RS.Fields("JOB_FILE_NBR")

strBody = "The Resource Brokering Request for Job File Number " &
strJob & vbCrLf _
& " will expire in 24 hours. Please extend the expiration date for
this request if necessary."


Set objNewMail = Server.CreateObject("CDONTS.NewMail")
objNewMail.From = strFrom
objNewMail.To = strTo
objNewMail.Subject = strSubject
objNewMail.Body = strBody
'objCDO.Send
Set objNewMail = Nothing


RS.MoveNext
Loop

%>
 
R

Ray at

Two things I see right at a glance.

1. You have your send command commented out.
2. If you were to uncomment that command, you'd be trying to send objCDO
instead of objNewMail.

Ray at work
 
M

Mike

Try this page first.

<%
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "(e-mail address removed)"
objEmail.To = "<your email address>"
objEmail.Subject = "cdotest"
objEmail.HTMLbody = Test
objEmail.Send
%>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,836
Latest member
login dogas

Latest Threads

Top