Need help with email script

Discussion in 'Site Programming, Development and Design' started by winhostdream123, Mar 8, 2010.

  1. Hello:

    Just wondering if anyone can help me with a small problem. Although I know something about ASP programming, I don't really understand scripts for sending email. I've searched the internet for a script and nothing seems to work for me.

    Winhost has posted some sample code at this link:

    I've pasted the code at the bottom with some modifications for my own purposes. I've created an email form using Flash MX. When I test it I get the following error message:

    CDO.Message.1 error '80040213'
    The transport failed to connect to the server.

    Anyway can anybody help me?

    I'm also wondering about the words that come after 'objMessage.' ('To', 'From', and 'Subject'). Are these some sort of variables which I can name myself? For example I want to add some code to accept form values which I named: form_name, form_phone, and form_message. Would this be the correct code?

    objMessage.Name = request.form("form_name")
    objMessage.Phone = request.form("form_phone")
    objMessage.Message = request.form("form_message")

    Here is the sample code from Winhost:

    set objMessage = createobject("cdo.message")
    set objConfig = createobject("cdo.configuration")
    Set Flds = objConfig.Fields

    Flds.Item("") = 2
    Flds.Item("") =""

    ' ' Passing SMTP authentication
    Flds.Item ("") = 1 'basic (clear-text) authentication
    Flds.Item ("") =""
    Flds.Item ("") ="password"

    Set objMessage.Configuration = objConfig
    objMessage.To = ""
    objMessage.From = request.form("form_address")
    objMessage.Subject = "New Task"
    objMessage.HTMLBody = "This is a test sent from CDO using smtp authentication."

    If anybody can help me then I thank you kindly,


    Last edited by a moderator: Oct 14, 2015
  2. Ray

    Ray and are merely examples. You will need to actually type your true email server name and the correct POP account email address.

Share This Page