CDONT-Autoresponder

M

Mark

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 = "(e-mail address removed)"
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
%>


%>
 
A

Aaron Bertrand - MVP

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 = "(e-mail address removed)"

to

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

?
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top