How can i make this script work using CDOSYS?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?YmV5YXo=?=

    #1

    How can i make this script work using CDOSYS?

    I have the follwing code and cannot receive e mails sent from my contact
    form. Please advise how can i make it work with CDOSYS. Thank you.

    <%
    form_from = "info@nnn.c om"
    form_to = "info@nnn.c om"
    form_cc = Request.Form("m ail_cc")
    form_bcc = Request.Form("m ail_bcc")
    form_subject = "Reality Form Submission"
    form_importance = 1

    FOR x = 1 TO Request.Form.Co unt
    IF Request.Form.Ke y(x) = "mail_from" OR Request.Form.Ke y(x) = "mail_to" OR
    Request.Form.Ke y(x) = "mail_cc" OR Request.Form.Ke y(x) = "mail_bcc" OR
    Request.Form.Ke y(x) = "mail_subje ct" OR Request.Form.Ke y(x) =
    "mail_importanc e" OR Request.Form.Ke y(x) = "mail_redir ect" OR
    Request.Form.Ke y(x) = "mail_send" OR Request.Form.Ke y(x) = "Submit" THEN
    form_variables = form_variables
    ELSE
    form_variables = form_variables & Request.Form.Ke y(x) & ": " & vbcrlf &
    Request.Form.It em(x) & vbcrlf & vbcrlf
    END IF
    NEXT

    DIM body_text
    body_text = vbcrlf & "~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~~~~~~~~" & vbcrlf
    body_text = body_text & form_subject & vbcrlf
    body_text = body_text & "~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~~~~~~~~" & vbcrlf
    & vbcrlf
    body_text = body_text & form_variables
    body_text = body_text & "Sent from: " & vbcrlf &
    Request.ServerV ariables("HTTP_ REFERER") & vbcrlf & vbcrlf
    body_text = body_text & "~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~~~~~~~~" & vbcrlf


    <!--SET objMail = Server.CreateOb ject("CDONTS.Ne wMail")-->

    SET objMail = CreateObject("C DO.Message")

    <!--objMail.BodyFor mat = 1-->
    <!--objMail.MailFor mat = 1-->

    objMail.Configu ration.Fields.I tem _
    ("http://schemas.microso ft.com/cdo/configuration/sendusing")=2

    objMail.Configu ration.Fields.I tem _
    ("http://schemas.microso ft.com/cdo/configuration/smtpserver") _
    ="127.0.0.1"

    objMail.Configu ration.Fields.I tem _
    ("http://schemas.microso ft.com/cdo/configuration/smtpserverport" ) _
    =25
    objMail.Configu ration.Fields.U pdate


    objMail.From = form_from
    objMail.To = form_to
    objMail.CC = form_cc
    objMail.BCC = form_bcc
    objMail.Subject = form_subject
    <!--objMail.Importa nce = form_importance-->
    objMail.TextBod y = body_text
    objMail.Send
    SET objMail = NOTHING

    Response.Write( "")
    %>
Working...