<%@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 dim strType, strSize, strLocation dim strMaterial, strGrade, strHeater dim strTV, strShow, strInternet dim strYellowPages, strOther, strOthertext '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("Comments") strDeptPhone = Request.form("dept_phone") strType = Request.form("Type") strSize = Request.form("Size") strLocation = Request.form("Location") strMaterial = Request.form("Material") strGrade = Request.form("Grade") strHeater = Request.form("Heater") strTV = Request.form("TV") strShow = Request.form("Show") strInternet = Request.form("Internet") strYellowPages = Request.form("YellowPages") strOther = Request.form("Other") strOthertext = Request.form("Othertext") strText = " Name: " & strName & vbCrLf & _ " Address: " & strAddress & vbCrLf & _ "City/State/Zip: " & strCSZ & vbCrLf & _ " Email Address: " & strAddr & vbCrLf & _ " Phone: " & strDeptPhone & vbCrLf & _ " Type: " & strType & vbCrLf & _ " Size: " & strSize & vbCrLf & _ " Location: " & strLocation & vbCrLf & _ " Material: " & strMaterial & vbCrLf & _ " Grade: " & strGrade & vbCrLf & _ " Heater: " & strHeater & vbCrLf & _ " TV: " & strTV & vbCrLf & _ " Show: " & strShow & vbCrLf & _ " Internet: " & strInternet & vbCrLf & _ "Yellow Pages: " & strYellowPages & vbCrLf & _ " Other: " & strOther & vbCrLf & _ " Other Text: " & strOthertext & vbCrLf & _ " Comments: " & strMsg & vbCrLf & "." send_email() function send_email() Dim objMail Set objMail = Server.CreateObject("CDO.Message") objMail.To = "sales@classicspas.com" objMail.From = "sales@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 & "
" &_ " Type: " & strType & "
" &_ " Size: " & strSize & "
" &_ " Location: " & strLocation & "
" &_ " Material: " & strMaterial & "
" &_ " Grade: " & strGrade & "
" &_ " Heater: " & strHeater & "
" &_ " TV: " & strTV & "
" &_ " Show: " & strShow & "
" &_ " Internet: " & strInternet & "
" &_ " Yellow Pages: " & strYellowPages & "
" &_ " Other: " & strOther & "
" &_ " Other Text: " & strOthertext & "
" &_ " Comments: " & strMsg & "

" &_ "Return to the e-mail form" end if end function %>

 


Comments to Sales Team