Copy and paste everything below this line.
Remember to save the file with an ".asp" extension.


<!--- This example illustrates the use of a "thank you" note after submitting a form --->

<TITLE>ASP Guestbook Thank You</TITLE>

Thanks for filling out our survey, <%=Request.form("yourname")%>.

<!-- The following area delineates and sends mail -->


' Set up variables to hold the text strings
Dim DestinationEmail
Dim OriginatingEmail
Dim Subject
Dim Body

' assign text to the variable
OriginatingEmail = Request.form("email")
DestinationEmail = ""
Subject = "The Subject Line Goes Here"

' The body contains all the form data separated by semicolons
Body = "Name = " & Request.form("yourname") & "; Email Address = " & Request.form("email") & "; Answer = " & Request.form("answer")

' Send email via the SendMail utility...note that this is an add-on to Active Server Pages and needs to be installed separatelly on the server.
Set email = Server.CreateObject("MPS.SendMail")
retCode = email.SendMail(OriginatingEmail, DestinationEmail, Subject, Body)

' Posts if mail has been sent or not
IF NOT True = retCode THEN
Response.write("Failed to send form results to "&DestinationEmail&" due to "&Err.Description&".<P>")
Response.write("Your form Results have been sent.<P>")

' Posts answer depending on radio button choice
IF Request.form("answer") = "yes" THEN
Response.write("I like Active Server Pages Too!")
Response.write("I don't like Active Server Pages either!")