ok, forum is back to normal....phew!
Hello everyone.
A client of mine had a previous web designer create a website for him....my job has been to fix all the errors as well as complete everything that the other designer left unfinished. Included in the site was a contact form in asp, that does not seem to work.
I know the very basics of asp (which have been enough so far to do my job) but I cannot seem to find what is wrong in the coding.
Here is the asp chunk of the coding for the contact form:
<%
if request.form("Submit")<>"" then
pEmailAdmin="info@nationalbusinesslistings.com"
strbname = Request.Form("bname")
strfname = Request.Form("fname")
strlname = Request.Form("lname")
strInNo = Request.Form("inNo")
strrefNo = Request.Form("reNo")
strCate = Request.Form("cate")
strAddress = Request.Form("address")
strCity = Request.Form("city")
strState = Request.Form("state")
strZip = Request.Form("zipcode")
strPhone = Request.Form("phone")
strPhone2 = Request.Form("phone2")
strFax = Request.Form("fax")
strWeb = Request.Form("website")
stremail = Request.Form("email")
strContactby = Request.Form("contactby")
strcomments = Request.Form("comments")
pBody1="<table border=0 cellspacing=5 cellpadding=0 align=center width=600 ><tr><td colspan=2>"
pBody1=pBody1&"The following information has been submitted through the Contact Us form</td></tr>"
pBody1=pBody1&"<tr><td width=250>Business Name</td><td>:</td><td width=200>"&strbname&"</td></tr>"
pBody1=pBody1&"<tr><td width=250>First Name</td><td>:</td><td width=200>"&strfname&"</td></tr>"
pBody1=pBody1&"<tr><td width=250>Last Name</td><td>:</td><td width=200>"&strlname&"</td></tr>"
pBody1=pBody1&"<tr><td width=250>Invoice No</td><td>:</td><td width=200>"&strInNo&"</td></tr>"
pBody1=pBody1&"<tr><td width=250>Reference No</td><td>:</td><td width=200>"&strrefNo&"</td></tr>"
pBody1=pBody1&"<tr><td width=250>Category</td><td>:</td><td width=200>"&strCate&"</td></tr>"
pBody1=pBody1&"<tr><td width=250>Address</td><td>:</td><td width=200>"&strAddress&"</td></tr>"
pBody1=pBody1&"<tr><td width=250>City</td><td>:</td><td width=200>"&strCity&"</td></tr>"
pBody1=pBody1&"<tr><td width=250>State</td><td>:</td><td width=200>"&strState&"</td></tr>"
pBody1=pBody1&"<tr><td width=250>Zip-Code</td><td>:</td><td width=200>"&strZip&"</td></tr>"
pBody1=pBody1&"<tr><td width=250>Phone</td><td>:</td><td width=200>"&strPhone&"</td></tr>"
pBody1=pBody1&"<tr><td width=250>Phone2</td><td>:</td><td width=200>"&strPhone2&"</td></tr>"
pBody1=pBody1&"<tr><td width=250>Fax</td><td>:</td><td width=200>"&strFax"</td></tr>"
pBody1=pBody1&"<tr><td width=250>Website</td><td>:</td><td width=200>"&strWeb&"</td></tr>"
pBody1=pBody1&"<tr><td width=250>Email Address</td><td>:</td><td width=200>"&stremail&"</td></tr>"
pBody1=pBody1&"<tr><td width=250>Contact By</td><td>:</td><td width=200>"&strContactby&"</td></tr>"
pBody1=pBody1&"<tr><td width=250>Comment</td><td>:</td><td width=200>"&strcomments&"</td></tr></table>"
//Response.Write(pBody1)
//Response.End()
// pEmailAdmin = stremail
Set objEMail = Server.CreateObject("CDO.Message")
Set objConfig = Server.CreateObject("CDO.Configuration")
Set Confi = objConfig.Fields
Confi("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
Confi("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "C:\inetpub\mailroot\pickup"
Confi.Update
Set objEMail.Configuration = objConfig
objEMail.To = pEmailAdmin
objEMail.From = stremail
objEMail.Subject = "Contact Us"
objEMail.HtmlBody = pBody1
on error resume next
objEMail.Send
Set objEMail = Nothing
//Starting the mail component section
msg="Thank you for contacting us, a representative will contact you soon"
end if
%>
<body >
<table width="780" cellpadding="0" cellspacing="0" align="center" style="border-left:#ddd 1px solid; border-right:#ddd 1px solid;">
<tr>
<td style="background-image:url(images/bar1.jpg) " height="20">
</td>
</tr>
<tr><td bgcolor="#FEF7EE" valign="top" height="40"> <a href="default.asp" class="navlink4">Home</a> » <b> Contact Us</b></td></tr>
<tr>
<td height="200" bgcolor="#FEF7EE" align="center" valign="middle">
<!-- <font size="+1">PAGE UNDER CONSTRUCTION</font> -->
<FORM name="contactfm" METHOD="POST" ACTION="contactus.asp" onsubmit="return chkcontact();">
<table cellspacing="10" cellpadding="0" border="0">
<tr><td colspan="3"><%=msg%></td></tr>
<tr>
<td colspan="3" height="20">
<i><b> Please fill out this form and a representative will contact you as soon as possible
</b>
</td>
</tr>
<tr><td colspan="2" align="right"></td></tr>
<tr><td colspan="2" align="right">
</td></tr>
<tr><td align="left" width="200">First Name</td><td width="300" align="left"><input type="text" name="fname" size="35"/></td></tr>
<tr><td align="left" width="200">* Last Name</td><td width="300" align="left"><input type="text" name="lname" size="35"/></td></tr>
<tr><td align="left" width="200">* Business Name</td><td width="300" align="left"><input type="text" name="bname" size="35"/></td></tr>
<tr><td align="left" width="200">Invoice No.</td><td width="300" align="left"><input type="text" name="inNo" size="35"/></td></tr>
<tr><td align="left" width="200">Reference No.</td><td width="300" align="left"><input type="text" name="reNo" size="35"/></td></tr>
<tr><td align="left" width="200">Address</td><td width="300" align="left"><input type="text" name="address" size="35"/></td></tr>
<tr><td align="left" width="200">City</td><td width="300" align="left"><input type="text" name="city" size="35"/></td></tr>
<tr><td align="left" width="200">* State</td><td width="300" align="left">
<select name="state">
<option value=""></option>
<%if not rsState.eof then %>
<%while not rsState.eof %>
<option value="<%=rsState("stateName")%>"><%=rsState("stateName")%></option>
<%rsState.movenext
Wend
end if%>
</select>
</td></tr>
<tr><td align="left" width="200">Zip-Code</td><td width="300" align="left"><input type="text" name="zipcode" size="25" /></td></tr>
<tr><td align="left" width="200">* Phone</td><td width="300" align="left"><input type="text" name="phone" size="35" onKeyDown="java script:return dFilter (event.keyCode, this, '(###) ###-####');"/></td></tr>
<tr><td align="left" width="200">Fax</td><td width="300" align="left"><input type="text" name="fax" size="35" onKeyDown="java script:return dFilter (event.keyCode, this, '(###) ###-####');"/></td></tr>
<tr>
<td align="right" width="225">Website<strong>http://</strong></td>
<td width="225" align="right"><input type="text" name="website" size="35"/></td></tr> <tr><td align="left">Email</td><td align="left"><input type="text" name="email" size="35"/></td></tr>
<tr><td align="left" width="200">Contact Method</td><td align="left">
<select name="contactby">
<option value="">Select</option>
<option value="Phone">Phone</option>
<option value="Email">Email</option>
<option value="">Other</option>
</select>
</td></tr>
<tr><td align="left" width="200" valign="top">* Comment</td><td align="left"><textarea name="comments" rows="6" cols="30"></textarea></td></tr>
<tr><td colspan="3" align="left"> <b><font color="#990000">*are required fields</font> </b></td></tr>
<tr><td colspan="1" height="20"></td></tr>
<tr align="center"><td colspan="3"><input type="submit" name="submit" value="Submit" class="button"></td>
</tr>
</table>
</form>
Do you have any questions or need help? <br>
Send all questions or comments to? <b><a href="mailto:info@nationalbusinesslistings.com" >info@nationalbusinesslistings.com</b></a>
</td>
</tr>
<!-- <tr align="left"><td colspan="2" bgcolor="#FEF7EE" > <b>*are required fields</b> </td>
</tr> -->
<tr>
<td style="background-image:url(images/bar2.jpg) " height="20">
</td>
</tr>
</table>
</td>
</tr>
<tr><td bgcolor="#FEF7EE" height="15">
Any and all help with fixing this form would be greatly appreciated.Tirus
Edited by Tirus, 19 August 2006 - 04:05 PM.
