%@ Language=VBScript %>
<% option explicit %>
<% Response.Buffer = True %>
<%
'Declaring Variables
Dim smtpserver,youremail,yourpassword,ContactUs_FirstName,ContactUs_LastName,ContactUs_Email
Dim ContactUs_PhoneNumber,ContactUs_BestTime,ContactUs_FaxNumber,ContactUs_CurrentAdd1,ContactUs_CurrentAdd2,ContactUs_PropertyAdd1,ContactUs_PropertyAdd2,ContactUs_Comments
Dim ContactUs_Subject,ContactUs_Body,Action,IsError
dim sNeeds
' Edit these 3 values accordingly.. leave the smtp server alone as it is set for Gmail
smtpserver = "smtp.gmail.com"
youremail = "wpinsurancect@gmail.com"
yourpassword = "wpinssrvcct"
'youremail = "johnschearer@gmail.com"
'yourpassword = "rogue6"
' Grabbing variables from the form post
ContactUs_FirstName = Request("FirstName")
ContactUs_LastName = Request("LastName")
ContactUs_Email = Request("E-MailAddress")
ContactUs_PhoneNumber = Request.Form("PhoneNumber")
ContactUs_BestTime = Request("BestTime")
ContactUs_FaxNumber = Request("FaxNumber")
ContactUs_CurrentAdd1 = Request("CurrentAdd1")
ContactUs_CurrentAdd2 = Request("CurrentAdd2")
ContactUs_PropertyAdd1 = Request("PropertyAdd1")
ContactUs_PropertyAdd2 = Request("PropertyAdd2")
ContactUs_Comments = Request("Comments")
ContactUs_Subject = "Request for a Quote"
ContactUs_Body = Request("ContactUs_Body")
Action = Request("Action")
sNeeds = ""
if len(Request.Form("chkhomeowners")) > 0 then
sNeeds = sNeeds + "Homeowners
"
end if
if len(Request.Form("chkLife") ) > 0 then
sNeeds = sNeeds + "Life
"
end if
if len(Request.Form("chkLongTermCare") ) > 0 then
sNeeds = sNeeds + "Long-Term Care
"
end if
if len(Request.Form("chkAutomobile") ) > 0 then
sNeeds = sNeeds + "Automobile
"
end if
if len(Request.Form("chkHealth") ) > 0 then
sNeeds = sNeeds + "Health
"
end if
if len(Request.Form("chkValuableArticles") ) > 0 then
sNeeds = sNeeds + "Valuable Articles
"
end if
if len(Request.Form("chkUmbrella") ) > 0 then
sNeeds = sNeeds + "Umbrella/Excess Liability
"
end if
if len(Request.Form("chkFlood") ) > 0 then
sNeeds = sNeeds + "Flood
"
end if
if len(Request.Form("chkYacht") ) > 0 then
sNeeds = sNeeds + "Yacht
"
end if
if len(Request.Form("chkCondo") ) > 0 then
sNeeds = sNeeds + "Condominium/Renters
"
end if
if len(Request.Form("chkDisability") ) > 0 then
sNeeds = sNeeds + "Disability
"
end if
' Used to check that the email entered is in a valid format
Function IsValidEmail(Email)
Dim ValidFlag,BadFlag,atCount,atLoop,SpecialFlag,UserName,DomainName,atChr,tAry1
ValidFlag = False
If (Email <> "") And (InStr(1, Email, "@") > 0) And (InStr(1, Email, ".") > 0) Then
atCount = 0
SpecialFlag = False
For atLoop = 1 To Len(Email)
atChr = Mid(Email, atLoop, 1)
If atChr = "@" Then atCount = atCount + 1
If (atChr >= Chr(32)) And (atChr <= Chr(44)) Then SpecialFlag = True
If (atChr = Chr(47)) Or (atChr = Chr(96)) Or (atChr >= Chr(123)) Then SpecialFlag = True
If (atChr >= Chr(58)) And (atChr <= Chr(63)) Then SpecialFlag = True
If (atChr >= Chr(91)) And (atChr <= Chr(94)) Then SpecialFlag = True
Next
If (atCount = 1) And (SpecialFlag = False) Then
BadFlag = False
tAry1 = Split(Email, "@")
UserName = tAry1(0)
DomainName = tAry1(1)
If (UserName = "") Or (DomainName = "") Then BadFlag = True
If Mid(DomainName, 1, 1) = "." then BadFlag = True
If Mid(DomainName, Len(DomainName), 1) = "." then BadFlag = True
ValidFlag = True
End If
End If
If BadFlag = True Then ValidFlag = False
IsValidEmail = ValidFlag
End Function
%>