Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2003
    new zealand

    Unanswered: newsletter problem sending emails...

    Hi there all,

    if sorted out the below problem by this: you must enter a valid email address into the FROM field on the form !Duh.

    I have a form submitting the message body to a list of email addresses. It all runs smoothly, except the actual email doesn't get sent...

    the code below is for the createnewsletter.asp page, receving the 'from' , 'subject' , and 'message' fields from a form on a previous page......

    but I think the problem is in this code below that is actually meant to SEND the email........I'm not getting any error messages.

    'our constants
    Const adOpenKeyset = 1
    Const adLockReadOnly = 1
    Const adCmdTable = &H0002
    'our variables for the email and for our objects
    Dim strTo , strFrom , strSubject , strBody , objCDONTS , objRS , objConn
    'get the results from the create newsletter form
    strFrom = Request.Form("from")
    strSubject = Request.Form("subject")
    strBody = Request.Form("message")
    Set objConn = Server.CreateObject("ADODB.Connection")
    objConn.Open "DBQ=" & Server.MapPath("../jjdendb/newsletter.mdb")& ";Driver={Microsoft Access Driver (*.mdb)}"
    Set objRS = Server.CreateObject("ADODB.RecordSet")
    objRS.Open "email" , objConn ,adOpenKeyset ,adLockReadOnly,adCmdTable
    'just a message to the admin
    Response.Write ("Newsletters are being created")
    response.Write ("<br>")
    'loop through entries
    While not objRS.EOF
    'create an instance of the CDONTS object
    Set objCDONTS = Server.CreateObject("CDONTS.NewMail")
    'set objCDONTS various properties
    objCDONTS.From = strFrom
    objCDONTS.To = objRS("email")
    objCDONTS.Subject = strSubject
    objCDONTS.Body = strBody
    Set objCDONTS = Nothing
    'print message for every entry
    Response.Write ("message sent to " & objRS("email") & "<br>")
    'move to next entry in database
    'message to admin saying creation has completed
    Response.Write ("newsletter creation completed ")

    can anyone help ??
    thanks heaps..
    Last edited by blondini3; 05-21-03 at 19:30.

  2. #2
    Join Date
    Mar 2003
    Atlanta, GA

    Re: newsletter problem sending emails...

    I don't see anything that hits me. Sometimes, email components are installed but don't actually send emails if configured incorrectly.

    Are you certain CDONTS is properly configured. I've known of at least a few situations where a reinstall of the OS or sometimes just a reboot of the Exchange server solved similar problems.

    Personally, I would try AspMail or AspEMail components. They're free, and offer a lot more functionality.

    Finally, for some code that DOES work, download the test file at

    there are 2 test files in the Zip file, one of which is a mailer test file, and tests for existance and correct configuration of several email components (including CDONTS) on the server.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts