my form is not validating correctly and i cannot see why, can anyone help. It is not maintaining data entered.
to view working example
<% Application("WEBSITE_EMAIL"
= "enter email address for mail to be sent here"
Application("SMTP_SERVER_NAME"
= "enter mailhost here"
DIM ErrorMsg,Name,Address,city,country,postcode,phone,email,gigdate,Attendance%>
<%
const numFields = 8
dim errorArray()
redim preserve errorArray(numFields)
if request.form("isSubmitted"
= "yes" then
name = request.form("name"
Address = request.form("Address"
city = request.form("city"
country = request.form("Country"
postcode = request.form("postcode"
phone = request.form("phone"
email = request.form("email"
gigdate = request.form("date"
ErrorMsg = ""
dim re
set re = New RegExp
'Name
re.Pattern = "^[^0-9\/><\.,\\!\^\$\*\+\?@#%&\(\);:\[\]\{\}=""']+$"
re.Global = True
re.IgnoreCase = True
errorArray(0) = re.Test(name)
if errorArray(0) then
errorArray(0)=False
else
errorArray(0) = True
ErrorMsg = "Name<br>"
end if
'Address #
re.Global = True
re.IgnoreCase = True
errorArray(1) = re.Test(Address)
if errorArray(1) then
errorArray(1) = False
else
errorArray(1) = True
ErrorMsg = ErrorMsg & "Address<br>"
end if
'City
re.Pattern = "^[^0-9\/><\.,\\!\^\$\*\+\?@#%&\(\);:\[\]\{\}=""']+$"
re.Global = True
re.IgnoreCase = True
errorArray(2) = re.Test(city)
if errorArray(2) then
errorArray(2) = False
else
errorArray(2) = True
ErrorMsg = ErrorMsg & "City<br>"
end if
'Post/Zip Code
re.Pattern = "^[^0-9\/><\.,\\!\^\$\*\+\?@#%&\(\);:\[\]\{\}=""']+$"
re.Global = True
re.IgnoreCase = True
errorArray(3) = re.Test(postcode)
if errorArray(3) then
errorArray(3) = False
else
errorArray(3) = True
ErrorMsg = ErrorMsg & "Postcode/Zip<br>"
end if
'Country
re.Pattern = "^[^0-9\/><\.,\\!\^\$\*\+\?@#%&\(\);:\[\]\{\}=""']+$"
re.Global = True
re.IgnoreCase = True
errorArray(4) = re.Test(country)
if errorArray(4) then
errorArray(4) = False
else
errorArray(4) = True
ErrorMsg = ErrorMsg & "Country<br>"
end if
'Telephone
re.Pattern = "^[^0-9\/><\.,\\!\^\$\*\+\?@#%&\(\);:\[\]\{\}=""']+$"
re.Global = True
re.IgnoreCase = True
errorArray(5) = re.Test(phone)
if errorArray(5) then
errorArray(5) = False
else
errorArray(5) = True
ErrorMsg = ErrorMsg & "Contact Phone Number<br>"
end if
'Email
re.Global = True
re.IgnoreCase = True
re.Pattern = "^\w+@\w+\.\w+"
errorArray(6) = re.Test(email)
if errorArray(6) then
errorArray(6) = False
else
errorArray(6) = True
ErrorMsg = ErrorMsg & "Email Address<br>"
end if
'gig date
re.Pattern = "^[^0-9\/><\.,\\!\^\$\*\+\?@#%&\(\);:\[\]\{\}=""']+$"
re.Global = True
re.IgnoreCase = True
errorArray(7) = re.Test(gigdate)
if errorArray(7) then
errorArray(7) = False
else
errorArray(7) = True
ErrorMsg = ErrorMsg & "Date<br>"
end if
end if
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Te Awatea</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<META NAME="keywords" CONTENT="Maori, Performance, maori performers, dance troupes, troupes, te awatea, new zealand">
<META NAME="description" CONTENT="Te Awatea is a Professional Maori Performing Arts group based in the heart of UK, London.....">
<META NAME="rating" CONTENT="General">
<META NAME="expires" CONTENT="never">
<META NAME="language" CONTENT="english">
<META NAME="charset" CONTENT="ISO-8859-1">
<META NAME="distribution" CONTENT="Global">
<META NAME="robots" CONTENT="INDEX,FOLLOW">
<META NAME="revisit-after" CONTENT="4 Days">
<META NAME="email" CONTENT="">
<META NAME="author" CONTENT="X-Creations">
<META NAME="publisher" CONTENT="<link rel="stylesheet" class="text/css" href="css/style.css">
<script src="include/functions.js" type="text/javascript"></script>
</head>
<body ONLOAD="preloadImages();" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!-- #include file="include/header.asp"-->
<table width="100%" border="0">
<tr>
<td> </td>
<td align="center" class="lgtext"><u>Contact Te Awatea for a Quote</u></td>
</tr>
<tr>
<td align="left" valign="top"><!-- #include file="navbar.asp"--></td>
<td><table border="0">
<tr>
<td height="21" align="center" class="text">Please complete the form below to submit
your enquiry about an event that Te Awatea could do for you. We will receive
this information and reply within 24 hours. Alternatively please contact
Chris Cameron on +44(0)77 966 784 73</td>
</tr>
<tr>
<td height="457">
<form action="<%=Request.ServerVariables("PATH_INFO"
%>" method="post">
<table width="60%" border="0" align="center">
<td width="47%" class="text"><% if errorArray(0) = True then %>
<font color="#ffff00"><b>
<% end if %>Name:
<% if errorArray(0) = True then %>
</b></font>
<% end if %></td>
<td width="53%">
<input name="Name" type="text" value="<%= name %>"> <span class="txtyel">*</span>
</td>
</tr>
<tr>
<td class="text"><% if errorArray(1) = True then %>
<font color="#ffff00"><b>
<% end if %>Address
<% if errorArray(1) = True then %>
</b></font>
<% end if %></td>
<td>
<input type="text" name="Address" value="<%= Address %>"> <span class="txtyel">*</span>
</td>
</tr>
<tr>
<td class="text"><% if errorArray(2) = True then %>
<font color="#ffff00"><b>
<% end if %>City<% if errorArray(2) = True then %>
</b></font>
<% end if %></td>
<td>
<input type="text" name="City" value="<%= city %>"> <span class="txtyel">*</span>
</td>
</tr>
<tr>
<td class="text"><% if errorArray(3) = True then %>
<font color="#ffff00"><b>
<% end if %>Postcode<% if errorArray(3) = True then %>
</b></font>
<% end if %></td>
<td>
<input type="text" name="Postcode" value="<%= postcode %>"> <span class="txtyel">*</span>
</td>
</tr>
<tr>
<td class="text"><% if errorArray(4) = True then %>
<font color="#ffff00"><b>
<% end if %>Country<% if errorArray(4) = True then %>
</b></font>
<% end if %></td>
<td>
<input type="text" name="Country" value="<%= country %>"> <span class="txtyel">*</span>
</td>
</tr>
<tr>
<td class="text"><% if errorArray(5) = True then %>
<font color="#ffff00"><b>
<% end if %>Contact Phone<% if errorArray(5) = True then %>
</b></font>
<% end if %></td>
<td>
<input type="text" name="Phone" valu="<%= phone %>"> <span class="txtyel">*</span>
</td>
</tr>
<tr>
<td class="text"><% if errorArray(6) = True then %>
<font color="#ffff00"><b>
<% end if %>Email<% if errorArray(6) = True then %>
</b></font>
<% end if %></td>
<td>
<input type="text" name="Email" value="<%= email %>"> <span class="txtyel">*</span>
</td>
</tr>
<tr>
<td class="text">Type of Event</td>
<td class="text">
<select name="select" size="1">
<option selected>Please Select </option>
<option>Promotional Event</option>
<option>Wedding</option>
<option>Coporate Seminar</option>
<option>Welcoming Visitors</option>
<option>Other</option>
</select>
</td>
</tr>
<tr>
<td width="47%" class="text"><% if errorArray(7) = True then %>
<font color="#ffff00"><b>
<% end if %>Date of Event:
<% if errorArray(7) = True then %>
</b></font>
<% end if %></td>
<td width="53%">
<input name="gigdate" type="text" value="<%= gigdate %>"> <span class="txtyel">*</span>
</td>
</tr>
<tr>
<td height="92" class="text">Please provide a brief description of what
type of event you are having...</td>
<td>
<textarea name="Description" cols="30" rows="5" id="description"></textarea>
</td>
</tr>
<tr>
<td height="34" class="text">How many people are attending?</td>
<td><input name="Attendance" type="text" id="Attendance" value=""></td>
</tr>
<tr>
<td> </td>
<td align="left" class="text">
<input type="submit" value="Submit">
<input type="hidden" name="isSubmitted" value="yes">
<input type="reset" value="Clear" />
</td>
</tr>
<tr>
<td align="center" colspan="2" class="text"> <span class="txtyel">*</span> denotes a required field
</table>
<%
if request.form("isSubmitted"
= "yes" then
if request.form("name"
> "" then
if request.form("gigdate"
> "" then
if request.form("address"
> "" then
if request.form("city"
> "" then
if request.form("postcode"
> "" then
if request.form("country"
> "" then
if request.form("phone"
> "" then
if request.form("email"
> "" then
if Request.Form("Description"
> "" then
strComments = replace(Request.Form("Description"
,vbcrlf,"<BR>"
else
strComments = "No comments given."
end if
if request.form("Attendance"
> "" then
strAttendance = replace(Request.form("Attendance"
,vbcrlf,"<br>"
else
strAttendance = "No attendance number given"
end if
Call SendEmail(Request.form("Select"
,strComments,Request.Form("Email"
,Application("WEBSITE_EMAIL"
,""
strMessage = "Thank you for filling out an Enquiry form./n/nSomeone will contact you within 24 hours."
else
strMessage = "Please fill in all the required fields!!"
end if
end if
end if
end if
end if
end if
end if
end if
if strMessage > "" then%>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
alert('<%=strMessage%>')
//-->
</SCRIPT>
<%end if
end if%>
</form>
<%
Function SendEmail(strSubject,strBody,strEmailFrom,strEmailsTo,strEmailsBCC)
'Generate the header content for the HTML email
strHTML = "<!DOCTYPE HTML PUBLIC""-//IETF//DTD HTML//EN"">"& vbcrlf
strHTML = strHTML & "<html>"& vbcrlf
strHTML = strHTML & "<head>"& vbcrlf
strHTML = strHTML & "<link href="" rel=""stylesheet"" type=""text/css"">"
strHTML = strHTML & "</head>" & vbcrlf
strHTML = strHTML & "<body leftmargin=""10"" topmargin=""10"" rightmargin=""0"" bottommargin=""0"" marginwidth=""0"" marginheight=""0""><div class=""text"">" & vbcrlf
strHTML = strHTML & Request.Form("Name"
& " has a peformance enquiry.Their details are as follows:<br>" & vbcrlf
strHTML = strHTML & "Name: " & Request.Form("Name"
& "<br>Address: " & Request.Form("Address"
& "<br>" & vbcrlf
strHTML = strHTML & "City: " & request.Form("City"
& "<br>Postcode: " & Request.form("Postcode"
& "<br>Country: " & Request.form("Country"
& vbcrlf
strHTML = strHTML & "<br>Phone: " & Request.form("Phone"
& "<br>Number of people Attending: " & strAttendance & vbcrlf
strHTML = strHTML & "<br><br>Date of event: " & Request.form("gigdate"
& vbcrlf
strHTML = strHTML & "<br><br>Description of event: " & strBody & vbcrlf
strHTML = strHTML & "<br>Please follow up with a call within 24 hours and mail information pack out." & vbcrlf
strHTML = strHTML & "<p><img src="" & vbcrlf
strHTML = strHTML & "</body>"& vbcrlf
strHTML = strHTML & "</html>"
if Application("ASPEMAIL"
then
Set mySmartMail = Server.CreateObject("aspSmartMail.SmartMail"
mySmartMail.Server = Application("SMTP_SERVER_NAME"
'mySmartMail.ServerPort = Application("SMTP_SERVER_PORT"
'mySmartMail.ServerTimeOut = 35
mySmartMail.ContentType= "text/html"
if strEmailsTo > "" then
arrEmailsTo = split(strEmailsTo,","
for lngEmailsTo = 0 to ubound(arrEmailsTo)
mySmartMail.Recipients.Add arrEmailsTo(lngEmailsTo)
next
else
mySmartMail.Recipients.Add Application("WEBSITE_EMAIL"
end if
if strEmailsBCC > "" then
arrEmailsBCC = split(strEmailsBCC,","
for lngEmailsBCC = 0 to ubound(arrEmailsBCC)
mySmartMail.BCCs.Add trim(arrEmailsBCC(lngEmailsBCC))
next
end if
if strEmailFrom > "" then
mySmartMail.SenderAddress = strEmailFrom
else
mySmartMail.SenderAddress = Application("WEBSITE_EMAIL"
end if
mySmartMail.Subject = strSubject
mySmartMail.Body = strHTML
mySmartMail.SendMail
Set mySmartMail = Nothing
end if
'count the amount of commas in both strEmailsTo and strEmailsBCC to get total number of messages sent else -1
lngEmailCount=-1
if strEmailsTo > "" then
lngEmailCount=1
end if
if strEmailsBCC > "" then
if lngEmailCount>=0 then
lngEmailCount = lngEmailCount+1
else
lngEmailCount=1
end if
end if
if instr(strEmailsTo,","
>0 then
lngEmailCount = lngEmailCount + Len(Replace(strEmailsTo, ",", "," & "*"
) - Len(strEmailsTo)
end if
if instr(strEmailsBCC,","
>0 then
lngEmailCount = lngEmailCount + Len(Replace(strEmailsBCC, ",", "," & "*"
) - Len(strEmailsBCC)
end if
SendEmail = lngEmailCount
End Function
%>
</td>
</tr>
</table>
</tr>
</td>
</table>
<!-- #include file="include/footer.htm"-->
</body>
</html>
to view working example
<% Application("WEBSITE_EMAIL"
Application("SMTP_SERVER_NAME"
DIM ErrorMsg,Name,Address,city,country,postcode,phone,email,gigdate,Attendance%>
<%
const numFields = 8
dim errorArray()
redim preserve errorArray(numFields)
if request.form("isSubmitted"
name = request.form("name"
Address = request.form("Address"
city = request.form("city"
country = request.form("Country"
postcode = request.form("postcode"
phone = request.form("phone"
email = request.form("email"
gigdate = request.form("date"
ErrorMsg = ""
dim re
set re = New RegExp
'Name
re.Pattern = "^[^0-9\/><\.,\\!\^\$\*\+\?@#%&\(\);:\[\]\{\}=""']+$"
re.Global = True
re.IgnoreCase = True
errorArray(0) = re.Test(name)
if errorArray(0) then
errorArray(0)=False
else
errorArray(0) = True
ErrorMsg = "Name<br>"
end if
'Address #
re.Global = True
re.IgnoreCase = True
errorArray(1) = re.Test(Address)
if errorArray(1) then
errorArray(1) = False
else
errorArray(1) = True
ErrorMsg = ErrorMsg & "Address<br>"
end if
'City
re.Pattern = "^[^0-9\/><\.,\\!\^\$\*\+\?@#%&\(\);:\[\]\{\}=""']+$"
re.Global = True
re.IgnoreCase = True
errorArray(2) = re.Test(city)
if errorArray(2) then
errorArray(2) = False
else
errorArray(2) = True
ErrorMsg = ErrorMsg & "City<br>"
end if
'Post/Zip Code
re.Pattern = "^[^0-9\/><\.,\\!\^\$\*\+\?@#%&\(\);:\[\]\{\}=""']+$"
re.Global = True
re.IgnoreCase = True
errorArray(3) = re.Test(postcode)
if errorArray(3) then
errorArray(3) = False
else
errorArray(3) = True
ErrorMsg = ErrorMsg & "Postcode/Zip<br>"
end if
'Country
re.Pattern = "^[^0-9\/><\.,\\!\^\$\*\+\?@#%&\(\);:\[\]\{\}=""']+$"
re.Global = True
re.IgnoreCase = True
errorArray(4) = re.Test(country)
if errorArray(4) then
errorArray(4) = False
else
errorArray(4) = True
ErrorMsg = ErrorMsg & "Country<br>"
end if
'Telephone
re.Pattern = "^[^0-9\/><\.,\\!\^\$\*\+\?@#%&\(\);:\[\]\{\}=""']+$"
re.Global = True
re.IgnoreCase = True
errorArray(5) = re.Test(phone)
if errorArray(5) then
errorArray(5) = False
else
errorArray(5) = True
ErrorMsg = ErrorMsg & "Contact Phone Number<br>"
end if
re.Global = True
re.IgnoreCase = True
re.Pattern = "^\w+@\w+\.\w+"
errorArray(6) = re.Test(email)
if errorArray(6) then
errorArray(6) = False
else
errorArray(6) = True
ErrorMsg = ErrorMsg & "Email Address<br>"
end if
'gig date
re.Pattern = "^[^0-9\/><\.,\\!\^\$\*\+\?@#%&\(\);:\[\]\{\}=""']+$"
re.Global = True
re.IgnoreCase = True
errorArray(7) = re.Test(gigdate)
if errorArray(7) then
errorArray(7) = False
else
errorArray(7) = True
ErrorMsg = ErrorMsg & "Date<br>"
end if
end if
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Te Awatea</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<META NAME="keywords" CONTENT="Maori, Performance, maori performers, dance troupes, troupes, te awatea, new zealand">
<META NAME="description" CONTENT="Te Awatea is a Professional Maori Performing Arts group based in the heart of UK, London.....">
<META NAME="rating" CONTENT="General">
<META NAME="expires" CONTENT="never">
<META NAME="language" CONTENT="english">
<META NAME="charset" CONTENT="ISO-8859-1">
<META NAME="distribution" CONTENT="Global">
<META NAME="robots" CONTENT="INDEX,FOLLOW">
<META NAME="revisit-after" CONTENT="4 Days">
<META NAME="email" CONTENT="">
<META NAME="author" CONTENT="X-Creations">
<META NAME="publisher" CONTENT="<link rel="stylesheet" class="text/css" href="css/style.css">
<script src="include/functions.js" type="text/javascript"></script>
</head>
<body ONLOAD="preloadImages();" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!-- #include file="include/header.asp"-->
<table width="100%" border="0">
<tr>
<td> </td>
<td align="center" class="lgtext"><u>Contact Te Awatea for a Quote</u></td>
</tr>
<tr>
<td align="left" valign="top"><!-- #include file="navbar.asp"--></td>
<td><table border="0">
<tr>
<td height="21" align="center" class="text">Please complete the form below to submit
your enquiry about an event that Te Awatea could do for you. We will receive
this information and reply within 24 hours. Alternatively please contact
Chris Cameron on +44(0)77 966 784 73</td>
</tr>
<tr>
<td height="457">
<form action="<%=Request.ServerVariables("PATH_INFO"
<table width="60%" border="0" align="center">
<td width="47%" class="text"><% if errorArray(0) = True then %>
<font color="#ffff00"><b>
<% end if %>Name:
<% if errorArray(0) = True then %>
</b></font>
<% end if %></td>
<td width="53%">
<input name="Name" type="text" value="<%= name %>"> <span class="txtyel">*</span>
</td>
</tr>
<tr>
<td class="text"><% if errorArray(1) = True then %>
<font color="#ffff00"><b>
<% end if %>Address
<% if errorArray(1) = True then %>
</b></font>
<% end if %></td>
<td>
<input type="text" name="Address" value="<%= Address %>"> <span class="txtyel">*</span>
</td>
</tr>
<tr>
<td class="text"><% if errorArray(2) = True then %>
<font color="#ffff00"><b>
<% end if %>City<% if errorArray(2) = True then %>
</b></font>
<% end if %></td>
<td>
<input type="text" name="City" value="<%= city %>"> <span class="txtyel">*</span>
</td>
</tr>
<tr>
<td class="text"><% if errorArray(3) = True then %>
<font color="#ffff00"><b>
<% end if %>Postcode<% if errorArray(3) = True then %>
</b></font>
<% end if %></td>
<td>
<input type="text" name="Postcode" value="<%= postcode %>"> <span class="txtyel">*</span>
</td>
</tr>
<tr>
<td class="text"><% if errorArray(4) = True then %>
<font color="#ffff00"><b>
<% end if %>Country<% if errorArray(4) = True then %>
</b></font>
<% end if %></td>
<td>
<input type="text" name="Country" value="<%= country %>"> <span class="txtyel">*</span>
</td>
</tr>
<tr>
<td class="text"><% if errorArray(5) = True then %>
<font color="#ffff00"><b>
<% end if %>Contact Phone<% if errorArray(5) = True then %>
</b></font>
<% end if %></td>
<td>
<input type="text" name="Phone" valu="<%= phone %>"> <span class="txtyel">*</span>
</td>
</tr>
<tr>
<td class="text"><% if errorArray(6) = True then %>
<font color="#ffff00"><b>
<% end if %>Email<% if errorArray(6) = True then %>
</b></font>
<% end if %></td>
<td>
<input type="text" name="Email" value="<%= email %>"> <span class="txtyel">*</span>
</td>
</tr>
<tr>
<td class="text">Type of Event</td>
<td class="text">
<select name="select" size="1">
<option selected>Please Select </option>
<option>Promotional Event</option>
<option>Wedding</option>
<option>Coporate Seminar</option>
<option>Welcoming Visitors</option>
<option>Other</option>
</select>
</td>
</tr>
<tr>
<td width="47%" class="text"><% if errorArray(7) = True then %>
<font color="#ffff00"><b>
<% end if %>Date of Event:
<% if errorArray(7) = True then %>
</b></font>
<% end if %></td>
<td width="53%">
<input name="gigdate" type="text" value="<%= gigdate %>"> <span class="txtyel">*</span>
</td>
</tr>
<tr>
<td height="92" class="text">Please provide a brief description of what
type of event you are having...</td>
<td>
<textarea name="Description" cols="30" rows="5" id="description"></textarea>
</td>
</tr>
<tr>
<td height="34" class="text">How many people are attending?</td>
<td><input name="Attendance" type="text" id="Attendance" value=""></td>
</tr>
<tr>
<td> </td>
<td align="left" class="text">
<input type="submit" value="Submit">
<input type="hidden" name="isSubmitted" value="yes">
<input type="reset" value="Clear" />
</td>
</tr>
<tr>
<td align="center" colspan="2" class="text"> <span class="txtyel">*</span> denotes a required field
</table>
<%
if request.form("isSubmitted"
if request.form("name"
if request.form("gigdate"
if request.form("address"
if request.form("city"
if request.form("postcode"
if request.form("country"
if request.form("phone"
if request.form("email"
if Request.Form("Description"
strComments = replace(Request.Form("Description"
else
strComments = "No comments given."
end if
if request.form("Attendance"
strAttendance = replace(Request.form("Attendance"
else
strAttendance = "No attendance number given"
end if
Call SendEmail(Request.form("Select"
strMessage = "Thank you for filling out an Enquiry form./n/nSomeone will contact you within 24 hours."
else
strMessage = "Please fill in all the required fields!!"
end if
end if
end if
end if
end if
end if
end if
end if
if strMessage > "" then%>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
alert('<%=strMessage%>')
//-->
</SCRIPT>
<%end if
end if%>
</form>
<%
Function SendEmail(strSubject,strBody,strEmailFrom,strEmailsTo,strEmailsBCC)
'Generate the header content for the HTML email
strHTML = "<!DOCTYPE HTML PUBLIC""-//IETF//DTD HTML//EN"">"& vbcrlf
strHTML = strHTML & "<html>"& vbcrlf
strHTML = strHTML & "<head>"& vbcrlf
strHTML = strHTML & "<link href="" rel=""stylesheet"" type=""text/css"">"
strHTML = strHTML & "</head>" & vbcrlf
strHTML = strHTML & "<body leftmargin=""10"" topmargin=""10"" rightmargin=""0"" bottommargin=""0"" marginwidth=""0"" marginheight=""0""><div class=""text"">" & vbcrlf
strHTML = strHTML & Request.Form("Name"
strHTML = strHTML & "Name: " & Request.Form("Name"
strHTML = strHTML & "City: " & request.Form("City"
strHTML = strHTML & "<br>Phone: " & Request.form("Phone"
strHTML = strHTML & "<br><br>Date of event: " & Request.form("gigdate"
strHTML = strHTML & "<br><br>Description of event: " & strBody & vbcrlf
strHTML = strHTML & "<br>Please follow up with a call within 24 hours and mail information pack out." & vbcrlf
strHTML = strHTML & "<p><img src="" & vbcrlf
strHTML = strHTML & "</body>"& vbcrlf
strHTML = strHTML & "</html>"
if Application("ASPEMAIL"
Set mySmartMail = Server.CreateObject("aspSmartMail.SmartMail"
mySmartMail.Server = Application("SMTP_SERVER_NAME"
'mySmartMail.ServerPort = Application("SMTP_SERVER_PORT"
'mySmartMail.ServerTimeOut = 35
mySmartMail.ContentType= "text/html"
if strEmailsTo > "" then
arrEmailsTo = split(strEmailsTo,","
for lngEmailsTo = 0 to ubound(arrEmailsTo)
mySmartMail.Recipients.Add arrEmailsTo(lngEmailsTo)
next
else
mySmartMail.Recipients.Add Application("WEBSITE_EMAIL"
end if
if strEmailsBCC > "" then
arrEmailsBCC = split(strEmailsBCC,","
for lngEmailsBCC = 0 to ubound(arrEmailsBCC)
mySmartMail.BCCs.Add trim(arrEmailsBCC(lngEmailsBCC))
next
end if
if strEmailFrom > "" then
mySmartMail.SenderAddress = strEmailFrom
else
mySmartMail.SenderAddress = Application("WEBSITE_EMAIL"
end if
mySmartMail.Subject = strSubject
mySmartMail.Body = strHTML
mySmartMail.SendMail
Set mySmartMail = Nothing
end if
'count the amount of commas in both strEmailsTo and strEmailsBCC to get total number of messages sent else -1
lngEmailCount=-1
if strEmailsTo > "" then
lngEmailCount=1
end if
if strEmailsBCC > "" then
if lngEmailCount>=0 then
lngEmailCount = lngEmailCount+1
else
lngEmailCount=1
end if
end if
if instr(strEmailsTo,","
lngEmailCount = lngEmailCount + Len(Replace(strEmailsTo, ",", "," & "*"
end if
if instr(strEmailsBCC,","
lngEmailCount = lngEmailCount + Len(Replace(strEmailsBCC, ",", "," & "*"
end if
SendEmail = lngEmailCount
End Function
%>
</td>
</tr>
</table>
</tr>
</td>
</table>
<!-- #include file="include/footer.htm"-->
</body>
</html>