%@ Language=VBScript %>
<%
' --- query string processing for error codes
' --- declare variables
Dim strErrText, strCode
strErrText = ""
strCode = Request.QueryString("code")
' --- check the querystring for code=value parameters and show the error
Select Case strCode
Case "1"
strErrText = "Please press the Back button to enter information in all required fields."
Case "2"
strErrText = "Please press the Back button to enter a valid email address."
End Select
' --- CDOSYS email processing
' --- make sure the PickUp folder in Exchange has NTFS write
' --- permissions for the respective application pool identity,
' --- default is NETWORK SERVICE
If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
Dim strFormManager, strName, strOrganization, strPhone, strEmail, strSubject, strText, strBody
strFormManager = "info@thewadegroupinc.com" ' --- change this email to desired FormManager email
' --- retrieve user input from the web form
strName = Trim(Request.Form("cName"))
strOrganization = Trim(Request.Form("cOrganization"))
strPhone = Trim(Request.Form("cPhone"))
strEmail = Trim(Request.Form("cEmail"))
strSubject = Trim(Request.Form("cSubject"))
strText = Trim(Request.Form("cText"))
'optGender = Request.Form("gender").Item
' --- check required fields for empty values
If strName = "" Or strOrganization = "" Or strPhone = "" Or strEmail = "" Or strSubject = "" Or strText = "" Then
Response.Redirect "contactform.asp?code=1"
End If
If isValidEmail(strEmail) <> true Then
Response.Redirect "contactform.asp?code=2"
End If
' --- begin email prep
Dim oMail
Set oMail = CreateObject("CDO.Message")
' --- build email from the web form fields
oMail.Subject = "Contact Form: " & strSubject
oMail.From = "\TheWadeGroup" & Chr(130) & " Inc" & Chr(46) & "\