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


<%@ LANGUAGE="VBSCRIPT" %>

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

<HTML>
<HEAD>
<TITLE>ASP Guestbook Thank You</TITLE>
</HEAD>

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

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

<P>
<%

' 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 = "you@email.com"
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>")
ELSE
Response.write("Your form Results have been sent.<P>")
END IF

' Posts answer depending on radio button choice
IF Request.form("answer") = "yes" THEN
Response.write("I like Active Server Pages Too!")
ELSE
Response.write("I don't like Active Server Pages either!")
END IF
%>
</BODY>
</HTML>