%
errorMsg=""
Success = ""
Dim oConn, oRs, objRS, mysql
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open(connectstr)
If Request("submit") <> "" then
If Request.Form("FirstName") = "" or Request.Form("LastName") = "" or Request.Form("title") = "" or Request.Form("Company") = "" or Request.Form("email") = "" or Request.Form("phone") = "" or Request.Form("AgencyType") = "" then
errorMsg = "One or more required fields are missing. Please enter the fields that are in red."
elseif Request.Form("findus") = "Other" and Request.Form("findusother") = "" then
errorMsg = "Please let us know how you find us."
else
datenow = Date()
mysql="insert into Results (FirstName, LastName, title, AgencyType, Company, City, State, Email, Phone, Comments, FoundUsFrom, FoundUsOther, Remote_computer_name, User_name, Browser_type) values ('"&Request.Form("FirstName")&"','"&Request.Form("LastName")&"','"&Request.Form("title")&"', '"&Request.Form("AgencyType")&"', '"&Request.Form("Company")&"', '"&Request.Form("city")&"', '"&Request.Form("state")&"', '"&Request.Form("email")&"', '"&Request.Form("phone")&"', '"&Request.Form("Comments")&"', '"&Request.Form("findus")&"', '"&Request.Form("findusother")&"', '"&Request.ServerVariables("REMOTE_HOST")&"', '"&Request.ServerVariables("REMOTE_USER")&"', '"&Request.ServerVariables("HTTP_USER_AGENT")&"')"
Set objRS = oConn.Execute(mysql)
Success = "Thank you, "&Request.Form("FirstName")&" "&Request.Form("LastName")&", for contacting us. We will contact you as soon as possible."
mailfrom = Request("email")
mailsubject = "Contact from resourcepro.com"
mailbody = "" & vbCrlf &_
""& vbCrlf &_
"
"
If Request("findus") = "Other" then
mailbody =mailbody&"
" & vbCrlf &_
"
Other:
" & vbCrlf &_
"
"&Request("findusother")&"
" & vbCrlf &_
"
"
end if
mailbody =mailbody&"
" & vbCrlf &_
"
Comments:
" & vbCrlf &_
"
"&Request("Comments")&"
" & vbCrlf &_
"
" & vbCrlf &_
"
" & vbCrlf &_
"
**********************************************
" & vbCrlf &_
"
" & vbCrlf &_
"
" & vbCrlf &_
"
Remote Computer IP Address:
" & vbCrlf &_
"
"&Request.ServerVariables("REMOTE_HOST")&"
" & vbCrlf &_
"
" & vbCrlf &_
"
" & vbCrlf &_
"
Remote User Name:
" & vbCrlf &_
"
"&Request.ServerVariables("REMOTE_USER")&"
" & vbCrlf &_
"
" & vbCrlf &_
"
" & vbCrlf &_
"
Browser Type:
" & vbCrlf &_
"
"&Request.ServerVariables("HTTP_USER_AGENT")&"
" & vbCrlf &_
"
" & vbCrlf &_
"
"
Dim Newmail
Set Newmail = server.CreateObject ("cdonts.newmail")
Newmail.BodyFormat = 0
Newmail.MailFormat = 0
Newmail.From = mailfrom
Newmail.To = "depstein@resourcepro.com" ' phwae@yahoo.com
Newmail.Subject = mailsubject
Newmail.Body = mailbody
Newmail.Send
Set Newmail = Nothing
end if
end if
%>
ReSource Pro - Contact Us