CDONT-Autoresponder

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mark

    #1

    CDONT-Autoresponder

    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("s ubmit")

    If isSubmitted <> "isSubmit" Then
    contactName = ""
    contactEmail = ""
    contactMessage = ""
    nameRequiredMes sage =""
    EmailRequiredMe ssage =""
    Else
    contactName = request.form("n ame")
    contactEmail = request.form("e mail")
    contactMessage = request.form("m essage")
    End If

    if contactName="" then
    nameRequiredMes sage = "Please enter your Name"
    end if

    if contactEmail="" then
    EmailRequiredMe ssage = "Please enter your Email"
    end if

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

    Set objCDONTS = Server.CreateOb ject("CDONTS.Ne wMail")
    objCDONTS.From = contactName & " <" & contactEmail & ">"
    objCDONTS.To = "mark@dcs-imago.com"
    objCDONTS.Subje ct = "dcs"
    objCDONTS.Body = "--------------------------------------" & vbcrlf & vbcrlf
    & contactMessage & vbcrlf & vbcrlf & vbcrlf &
    "--------------------------------------------------------------" & vbcrlf &
    "MESSAGE ENDS: End of message"
    objCDONTS.Send
    Set objCDONTS = Nothing

    response.redire ct "thanks.asp "
    response.end
    end if
    %>


    %>


  • Aaron Bertrand - MVP

    #2
    Re: CDONT-Autoresponder

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

    How is it any different setting:

    objCDONTS.To = "mark@dcs-imago.com"

    to

    objCDONTS.To = request.form("e mail")

    ?



    "Mark" <No@Email.com > wrote in message
    news:bg3g49$iqk $1@titan.btinte rnet.com...[color=blue]
    > When a form is filled in on my website it is sent to the below .asp page.[/color]
    I[color=blue]
    > 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("s ubmit")
    >
    > If isSubmitted <> "isSubmit" Then
    > contactName = ""
    > contactEmail = ""
    > contactMessage = ""
    > nameRequiredMes sage =""
    > EmailRequiredMe ssage =""
    > Else
    > contactName = request.form("n ame")
    > contactEmail = request.form("e mail")
    > contactMessage = request.form("m essage")
    > End If
    >
    > if contactName="" then
    > nameRequiredMes sage = "Please enter your Name"
    > end if
    >
    > if contactEmail="" then
    > EmailRequiredMe ssage = "Please enter your Email"
    > end if
    >
    > If contactName<>"" and contactEmail<>" " then
    > Dim objCDONTS ' Email object
    > Dim strSubject, strBody ' Message
    > Dim misccompo
    >
    > Set objCDONTS = Server.CreateOb ject("CDONTS.Ne wMail")
    > objCDONTS.From = contactName & " <" & contactEmail & ">"
    > objCDONTS.To = "mark@dcs-imago.com"
    > objCDONTS.Subje ct = "dcs"
    > objCDONTS.Body = "--------------------------------------" & vbcrlf &[/color]
    vbcrlf[color=blue]
    > & contactMessage & vbcrlf & vbcrlf & vbcrlf &
    > "--------------------------------------------------------------" & vbcrlf[/color]
    &[color=blue]
    > "MESSAGE ENDS: End of message"
    > objCDONTS.Send
    > Set objCDONTS = Nothing
    >
    > response.redire ct "thanks.asp "
    > response.end
    > end if
    > %>
    >
    >
    > %>
    >
    >[/color]


    Comment

    Working...