%@language="VBScript"%>
<%Option Explicit%>
ASP E-mail Form
<%
'Declare variables for the form input fields and the e-mail
dim strAddr, replyTo, strSubject, strName
dim strMsg, strDeptPhone, strAddress
dim strCSZ, strText, strPosition
'Get input from the form and assign it to script variables
strAddr = Trim(Request.form("user_email"))
if strAddr <> "" then
replyTo = cstr(strAddr)
end if
strSubject = Request.form("user_subject")
strName = Request.form("user_name")
strAddress = Request.form("user_address")
strCSZ = Request.form("user_CSZ")
strMsg = Request.form("Experience")
strPosition = Request.form("Position")
strDeptPhone = Request.form("dept_phone")
strText = " Name: " & strName & vbCrLf & _
" Address: " & strAddress & vbCrLf & _
"City/State/Zip: " & strCSZ & vbCrLf & _
" Email Address: " & strAddr & vbCrLf & _
" Phone: " & strDeptPhone & vbCrLf & _
" Position: " & strPosition & vbCrLf & _
" Experience: " & strMsg & vbCrLf & "."
send_email()
function send_email()
Dim objMail
Set objMail = Server.CreateObject("CDO.Message")
objMail.To = "employment@classicspas.com"
objMail.From = "employment@classicspas.com"
objMail.ReplyTo = replyTo
objMail.Subject = strSubject
objMail.TextBody = strText
objMail.Send
Set objMail = Nothing
if err.number > 0 then
response.write "Errors were encountered in sending your e-mail message. "&_
"Please try again, or contact the webmaster"
else
'reformat strMsg to preserve line breaks in the question textarea
strMsg = replace(strMsg,vbcrlf,"
")
response.write "Thank you for using our e-mail form!
" &_
"Your information was submitted as follows:
" &_
" Name: " & strName & "
" &_
" Address: " & strAddress & "
" &_
"City/State/Zip: " & strCSZ & "
" &_
"E-mail Address: " & strAddr & "
" &_
" Phone: " & strDeptPhone & "
" &_
" Position: " & strPosition & "
" &_
" Experience: " & strMsg & "
" &_
"Return to the e-mail form"
end if
end function
%>
Comments to Sales Team