CDONTS Problem - no error msg

Discussion in 'ASP General' started by Janet, Jul 30, 2003.

  1. Janet

    Janet Guest

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

    %>
     
    Janet, Jul 30, 2003
    #1
    1. Advertisements

  2. Janet

    Ray at Guest

    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
     
    Ray at, Jul 30, 2003
    #2
    1. Advertisements

  3. Janet

    Mike Guest

    Try this page first.

    <%
    Set objEmail = CreateObject("CDO.Message")
    objEmail.From = ""
    objEmail.To = "<your email address>"
    objEmail.Subject = "cdotest"
    objEmail.HTMLbody = Test
    objEmail.Send
    %>
     
    Mike, Jul 30, 2003
    #3
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.