how can i change CDONTS values to CDOSYS?

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

    how can i change CDONTS values to 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( "")
    %>

  • Anthony Jones

    #2
    Re: how can i change CDONTS values to CDOSYS?

    "beyaz" <beyaz@discussi ons.microsoft.c omwrote in message
    news:7DDC512E-53A6-4BCD-BA1B-1B55AD165330@mi crosoft.com...
    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( "")
    %>
    >

    The code looks a little weird but should work.

    What error are you getting?
    Are there errors in the event log on your system?
    Do the emails end up in the bad mail folder or just sit in the queue of your
    SMTP server?
    Have you checked that your SMTP allows relay from 127.0.0.1?



    --
    Anthony Jones - MVP ASP/ASP.NET


    Comment

    Working...