CDO Message not sending

Discussion in 'Classic ASP' started by bebemau, Nov 2, 2003.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hello again,

    I read the knowledge base here and found the article on how to use the CDO object. So I basically copied everything and my page runs fine however, the mail did not get sent. Do I have to change the smtp server or the sendusing field?

    Heres my code:
    set myMessage=createObject("cdo.message")
    set myConfig=createObject("cdo.configuration")
    set myFields=myConfig.Fields
    myFields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    myFields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
    myFields.update

    Set myMessage.Configuration = myConfig
    myMessage.to="[email protected]"
    myMessage.From = "[email protected]"
    myMessage.Subject = "A prayer was sent"
    myMessage.TextBody = strBody
    myMessage.Fields.update
    myMessage.Send
    set myFields=nothing
    set myMessage=nothing
    set myConfig=nothing

    Thanks in advance
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    No. You need not change those fields.

    Make sure the from & to address is valid.

    quote:Originally posted by bebemau

    Hello again,

    I read the knowledge base here and found the article on how to use the CDO object. So I basically copied everything and my page runs fine however, the mail did not get sent. Do I have to change the smtp server or the sendusing field?

    Heres my code:
    set myMessage=createObject("cdo.message")
    set myConfig=createObject("cdo.configuration")
    set myFields=myConfig.Fields
    myFields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    myFields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
    myFields.update

    Set myMessage.Configuration = myConfig
    myMessage.to="[email protected]"
    myMessage.From = "[email protected]"
    myMessage.Subject = "A prayer was sent"
    myMessage.TextBody = strBody
    myMessage.Fields.update
    myMessage.Send
    set myFields=nothing
    set myMessage=nothing
    set myConfig=nothing

    Thanks in advance
    </blockquote id="quote"></font id="quote">
     
  3. if the to address is invalid, what kind of error msg I will get? How to handle this kind of error? I tried to send a email to invalid email address and the web page is very slow, then it says i need to change the timeout time. Any idea about this? thanks.
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page