problem with the cdo object in asp

Discussion in 'Classic ASP' started by riadazad, Feb 4, 2004.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. i have a problem with the cdo object while i am sending email from my classic asp form. as per discount asp.net's sample cdo.asp iam using the following codes in the page

    Set Flds = objConfig.Fields
    Flds.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    Flds.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
    Flds.update

    along with other necessary initialization of cdo.message and cdo.config, their sample(cdo.asp) works fine when i upload but my page (publicemail.asp)is not working.

    can anybody please help me asap as my project is due soon. in fact if this part works then i will get data from a form and then send through.

    here i attach my whole code of the page publicemail.asp

    <%
    'The header/footer for the email.
    'Const strHeader = "Here are the results of the form:"
    'Const strFooter = "Form mailer created by Metz development"

    'Who does this go to?
    'dim strTo = "[email protected]"

    'Dim strBody
    'strBody = strHeader & vbCrLf & vbCrLf
    'strBody = "test FORM: Riad Azad "
    'strBody = strBody & vbCrLf & strFooter


    set objConfig = createobjectt("cdo.configuration")

    Set Flds = objConfig.Fields
    Flds.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    Flds.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
    Flds.update


    'Time to send the email
    'Dim objCDO
    Set objCDO = createobject("cdo.message")
    'Set objCDO = Server.CreateObject("CDONTS.NewMail")

    Set objCDO.Configuration = objConfig
    objCDO.To = "[email protected]"
    objCDO.From = "[email protected]"
    objCDO.Subject = "This is a sample email sent using CDO by Riad Azad"
    objCDO.TextBody = "test FORM: Riad Azad "
    objCDO.fields.update

    objCDO.Send



    'Response.Redirect("confirmation.html")
    Response.write "Mail sent from Riad Azad..."

    Set objCDO = Nothing
    set objConfig = nothing
    %>



    Riad Azad
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    Did you get any error message?

    quote:Originally posted by riadazad

    i have a problem with the cdo object while i am sending email from my classic asp form. as per discount asp.net's sample cdo.asp iam using the following codes in the page

    Set Flds = objConfig.Fields
    Flds.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    Flds.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
    Flds.update

    along with other necessary initialization of cdo.message and cdo.config, their sample(cdo.asp) works fine when i upload but my page (publicemail.asp)is not working.

    can anybody please help me asap as my project is due soon. in fact if this part works then i will get data from a form and then send through.

    here i attach my whole code of the page publicemail.asp

    <%
    'The header/footer for the email.
    'Const strHeader = "Here are the results of the form:"
    'Const strFooter = "Form mailer created by Metz development"

    'Who does this go to?
    'dim strTo = "[email protected]"

    'Dim strBody
    'strBody = strHeader & vbCrLf & vbCrLf
    'strBody = "test FORM: Riad Azad "
    'strBody = strBody & vbCrLf & strFooter


    set objConfig = createobjectt("cdo.configuration")

    Set Flds = objConfig.Fields
    Flds.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    Flds.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
    Flds.update


    'Time to send the email
    'Dim objCDO
    Set objCDO = createobject("cdo.message")
    'Set objCDO = Server.CreateObject("CDONTS.NewMail")

    Set objCDO.Configuration = objConfig
    objCDO.To = "[email protected]"
    objCDO.From = "[email protected]"
    objCDO.Subject = "This is a sample email sent using CDO by Riad Azad"
    objCDO.TextBody = "test FORM: Riad Azad "
    objCDO.fields.update

    objCDO.Send



    'Response.Redirect("confirmation.html")
    Response.write "Mail sent from Riad Azad..."

    Set objCDO = Nothing
    set objConfig = nothing
    %>



    Riad Azad
    </blockquote id="quote"></font id="quote">
     
  3. I am not sure if you have noticed but on the line where you are settng your objConfig you have CreateObject spelled incorrectly.

    I generally spell object with one 't' and not two.
     
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