% @LANGUAGE = VBScript %>
<% Option Explicit %>
<%
' name attribute of submit button
If Request.Form("Submit")<>"" then
Dim strName, strEmail, strQuery
strName = Trim(Request.Form("lastName"))
strEmail = Trim(Request.Form("email"))
strQuery = "" &_
"First Name - " & Request.Form("firstName") & VbCrlf &_
"Last Name - " & Request.Form("lastName") & VbCrlf &_
"Address - " & Request.Form("street") & VbCrlf &_
"City - " & Request.Form("city") & VbCrlf &_
"State - " & Request.Form("state") & VbCrlf &_
"Zip - " & Request.Form("zip") & VbCrlf &_
"Phone - " & Request.Form("phone") & VbCrlf &_
"Work Phone - " & Request.Form("work") & VbCrlf &_
"Email - " & Request.Form("email") & VbCrlf
'response.write(strQuery & "
")
'response.end
if (strName <> "" And strEmail <> "") Then
on error resume next ' disable Error Handler
Dim objMail
Set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.From = "info@hsa4you.com"
objMail.To = "phil@betabenefits.com"
objMail.Subject = "Your Inquiry " & strName
objMail.Body = strQuery
objMail.Send
Set objMail = Nothing
if err.number<>0 then
response.write(err.description)
end if
on error GOTO 0 ' restore to default behavior(HALT)
Response.Redirect("thanks.htm")
end if
Else ' FORM SUBMIT
%>