CDONT-Autoresponder

Discussion in 'ASP General' started by Mark, Jul 28, 2003.

  1. Mark

    Mark Guest

    When a form is filled in on my website it is sent to the below .asp page. I
    want the information from the form to be sent to me, which it does, but I
    would also like a confirmation email to be sent to the user. Is there
    anything i can add to the code below to do this?
    <%
    dim contactName, contactEmail, contactMessage, isSubmitted, nameRequired,
    EmailRequired

    isSubmitted = request.form("submit")

    If isSubmitted <> "isSubmit" Then
    contactName = ""
    contactEmail = ""
    contactMessage = ""
    nameRequiredMessage =""
    EmailRequiredMessage =""
    Else
    contactName = request.form("name")
    contactEmail = request.form("email")
    contactMessage = request.form("message")
    End If

    if contactName="" then
    nameRequiredMessage = "Please enter your Name"
    end if

    if contactEmail="" then
    EmailRequiredMessage = "Please enter your Email"
    end if

    If contactName<>"" and contactEmail<>"" then
    Dim objCDONTS ' Email object
    Dim strSubject, strBody ' Message
    Dim misccompo

    Set objCDONTS = Server.CreateObject("CDONTS.NewMail")
    objCDONTS.From = contactName & " <" & contactEmail & ">"
    objCDONTS.To = ""
    objCDONTS.Subject = "dcs"
    objCDONTS.Body = "--------------------------------------" & vbcrlf & vbcrlf
    & contactMessage & vbcrlf & vbcrlf & vbcrlf &
    "--------------------------------------------------------------" & vbcrlf &
    "MESSAGE ENDS: End of message"
    objCDONTS.Send
    Set objCDONTS = Nothing

    response.redirect "thanks.asp"
    response.end
    end if
    %>


    %>
     
    Mark, Jul 28, 2003
    #1
    1. Advertising

  2. Sure, set up another snippet for sending mail, set the *recipient* to
    request.form("email"), and change the body.

    How is it any different setting:

    objCDONTS.To = ""

    to

    objCDONTS.To = request.form("email")

    ?



    "Mark" <> wrote in message
    news:bg3g49$iqk$...
    > When a form is filled in on my website it is sent to the below .asp page.

    I
    > want the information from the form to be sent to me, which it does, but I
    > would also like a confirmation email to be sent to the user. Is there
    > anything i can add to the code below to do this?
    > <%
    > dim contactName, contactEmail, contactMessage, isSubmitted, nameRequired,
    > EmailRequired
    >
    > isSubmitted = request.form("submit")
    >
    > If isSubmitted <> "isSubmit" Then
    > contactName = ""
    > contactEmail = ""
    > contactMessage = ""
    > nameRequiredMessage =""
    > EmailRequiredMessage =""
    > Else
    > contactName = request.form("name")
    > contactEmail = request.form("email")
    > contactMessage = request.form("message")
    > End If
    >
    > if contactName="" then
    > nameRequiredMessage = "Please enter your Name"
    > end if
    >
    > if contactEmail="" then
    > EmailRequiredMessage = "Please enter your Email"
    > end if
    >
    > If contactName<>"" and contactEmail<>"" then
    > Dim objCDONTS ' Email object
    > Dim strSubject, strBody ' Message
    > Dim misccompo
    >
    > Set objCDONTS = Server.CreateObject("CDONTS.NewMail")
    > objCDONTS.From = contactName & " <" & contactEmail & ">"
    > objCDONTS.To = ""
    > objCDONTS.Subject = "dcs"
    > objCDONTS.Body = "--------------------------------------" & vbcrlf &

    vbcrlf
    > & contactMessage & vbcrlf & vbcrlf & vbcrlf &
    > "--------------------------------------------------------------" & vbcrlf

    &
    > "MESSAGE ENDS: End of message"
    > objCDONTS.Send
    > Set objCDONTS = Nothing
    >
    > response.redirect "thanks.asp"
    > response.end
    > end if
    > %>
    >
    >
    > %>
    >
    >
     
    Aaron Bertrand - MVP, Jul 28, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jim
    Replies:
    1
    Views:
    340
  2. xmanclick1
    Replies:
    0
    Views:
    224
    xmanclick1
    Feb 14, 2010
  3. michaaal
    Replies:
    1
    Views:
    134
    Evertjan.
    Jul 9, 2003
  4. Gonzosez

    cdont problem

    Gonzosez, Feb 6, 2004, in forum: ASP General
    Replies:
    1
    Views:
    106
    Ray at
    Feb 6, 2004
  5. Harvey Waxman

    CDONT to CDO

    Harvey Waxman, Feb 28, 2004, in forum: ASP General
    Replies:
    9
    Views:
    165
    Aaron Bertrand [MVP]
    Apr 15, 2004
Loading...

Share This Page