JimmyReckless
Technical User
Hey,
I've almost finished building a website for a customer, but they've decided they want a brochure request form on their site. I tried to use Perl, but the new server we're on doesnt support Perl Sendmail. They do have Jmail or ASPMail installed however.
The website is online now:
Now. I've never used ASP before and I'm stuck. I've tried to use a program called FormsToGo by Bebesoft.Com. And I've tried to do it manually using ASPmail, but it just comes up with errors. Here is the ASPmail (Persits) code that FormsToGo generated:
<%
Dim aspEMail
Set aspEMail = Server.CreateObject("Persits.MailSender")
name = request.form("name")
address1 = request.form("address1")
townCity = request.form("townCity")
postcode = request.form("postcode")
telephone = request.form("telephone")
email = request.form("email")
' Redirect user to the error page
If (validationFailed = true) Then
Response.Redirect "error.html"
Response.End
End If
' Owner Email: aspEmail
emailFrom = email
emailSubject = "Brochure Form"
emailBodyText = "name: " & name & "" & vbCrLf _
& "address1: " & address1 & "" & vbCrLf _
& "townCity: " & townCity & "" & vbCrLf _
& "postcode: " & postcode & "" & vbCrLf _
& "telephone: " & telephone & "" & vbCrLf _
& "email: " & email & "" & vbCrLf _
& "" & vbCrLf _
& ""
aspEmail.Host = "10.2.5.10"
aspEmail.Username = "********"
aspEmail.Password = "******"
aspEmail.From = emailFrom
aspEMail.AddAddress "********@btinternet.com", ""
aspEmail.Subject = emailSubject
aspEmail.Body = emailBodyText
aspEmail.Charset = "ISO-8859-1"
aspEmail.ContentTransferEncoding = "quoted-printable"
On Error Resume Next
aspEmail.Send
If Err <> 0 then
Response.Write "aspEmail reported an error sending the email. Error: " & Err.Description
End If
' Redirect user to success page
Response.Redirect "success.html"
' End of ASP script
%>
And this is the HTML Form code:
<form name="brochure" method="post" action="sendform.asp" onSubmit="MM_validateForm('name','','R','telephone','','RisNum','email','','RisEmail');return document.MM_returnValue">
<table width="100%" border="0" cellspacing="5" cellpadding="1">
<tr>
<td width="33%">
<div align="right"><b>Name: </b></div>
</td>
<td width="67%">
<input type="text" name="name" value="" maxlength="50" size="50">
</td>
</tr>
<tr>
<td width="33%">
<div align="right"><b>Address: </b></div>
</td>
<td width="67%">
<input type="text" name="address1" size="50" maxlength="50">
</td>
</tr>
<tr>
<td width="33%">
<div align="right"><b>Town/City: </b></div>
</td>
<td width="67%">
<input type="text" name="townCity" size="50" maxlength="50">
</td>
</tr>
<tr>
<td width="33%">
<div align="right"><b>Postcode:</b> </div>
</td>
<td width="67%">
<input type="text" name="postcode" size="20" maxlength="20">
</td>
</tr>
<tr>
<td width="33%" height="29">
<div align="right"><b>Telephone Number: </b></div>
</td>
<td width="67%" height="29">
<input type="text" name="telephone" size="20" maxlength="20">
</td>
</tr>
<tr>
<td width="33%">
<div align="right"><b>Email Address</b></div>
</td>
<td width="67%">
<input type="text" name="email" size="50" maxlength="50">
</td>
</tr>
</table>
<p align="center"> Where did you hear about us?
<select name="select" size="1">
<option selected>Please select</option>
<option>The Garden</option>
<option>Country Living</option>
<option>Homes & Gardens</option>
<option>House & Gardens</option>
<option>The English Garden</option>
<option>Country Homes & Interiors</option>
<option>Ideal Homes</option>
<option>Internet/Web Search</option>
<option>Other</option>
</select>
</p>
<p align="center">
<input type="radio" name="radiobutton" value="radiobutton">
Brochure
<input type="radio" name="radiobutton" value="radiobutton">
Consultation </p>
<p align="center">
<input type="submit" name="submit" value="Submit">
<input type="reset" name="reset" value="Reset">
</p>
</form>
When I submit the form it just keeps coming up with errors like: Server 500, or 404 Cant find form.
Any ideas anyone on whats going wrong? Im stumped.
Thanks
James
I've almost finished building a website for a customer, but they've decided they want a brochure request form on their site. I tried to use Perl, but the new server we're on doesnt support Perl Sendmail. They do have Jmail or ASPMail installed however.
The website is online now:
Now. I've never used ASP before and I'm stuck. I've tried to use a program called FormsToGo by Bebesoft.Com. And I've tried to do it manually using ASPmail, but it just comes up with errors. Here is the ASPmail (Persits) code that FormsToGo generated:
<%
Dim aspEMail
Set aspEMail = Server.CreateObject("Persits.MailSender")
name = request.form("name")
address1 = request.form("address1")
townCity = request.form("townCity")
postcode = request.form("postcode")
telephone = request.form("telephone")
email = request.form("email")
' Redirect user to the error page
If (validationFailed = true) Then
Response.Redirect "error.html"
Response.End
End If
' Owner Email: aspEmail
emailFrom = email
emailSubject = "Brochure Form"
emailBodyText = "name: " & name & "" & vbCrLf _
& "address1: " & address1 & "" & vbCrLf _
& "townCity: " & townCity & "" & vbCrLf _
& "postcode: " & postcode & "" & vbCrLf _
& "telephone: " & telephone & "" & vbCrLf _
& "email: " & email & "" & vbCrLf _
& "" & vbCrLf _
& ""
aspEmail.Host = "10.2.5.10"
aspEmail.Username = "********"
aspEmail.Password = "******"
aspEmail.From = emailFrom
aspEMail.AddAddress "********@btinternet.com", ""
aspEmail.Subject = emailSubject
aspEmail.Body = emailBodyText
aspEmail.Charset = "ISO-8859-1"
aspEmail.ContentTransferEncoding = "quoted-printable"
On Error Resume Next
aspEmail.Send
If Err <> 0 then
Response.Write "aspEmail reported an error sending the email. Error: " & Err.Description
End If
' Redirect user to success page
Response.Redirect "success.html"
' End of ASP script
%>
And this is the HTML Form code:
<form name="brochure" method="post" action="sendform.asp" onSubmit="MM_validateForm('name','','R','telephone','','RisNum','email','','RisEmail');return document.MM_returnValue">
<table width="100%" border="0" cellspacing="5" cellpadding="1">
<tr>
<td width="33%">
<div align="right"><b>Name: </b></div>
</td>
<td width="67%">
<input type="text" name="name" value="" maxlength="50" size="50">
</td>
</tr>
<tr>
<td width="33%">
<div align="right"><b>Address: </b></div>
</td>
<td width="67%">
<input type="text" name="address1" size="50" maxlength="50">
</td>
</tr>
<tr>
<td width="33%">
<div align="right"><b>Town/City: </b></div>
</td>
<td width="67%">
<input type="text" name="townCity" size="50" maxlength="50">
</td>
</tr>
<tr>
<td width="33%">
<div align="right"><b>Postcode:</b> </div>
</td>
<td width="67%">
<input type="text" name="postcode" size="20" maxlength="20">
</td>
</tr>
<tr>
<td width="33%" height="29">
<div align="right"><b>Telephone Number: </b></div>
</td>
<td width="67%" height="29">
<input type="text" name="telephone" size="20" maxlength="20">
</td>
</tr>
<tr>
<td width="33%">
<div align="right"><b>Email Address</b></div>
</td>
<td width="67%">
<input type="text" name="email" size="50" maxlength="50">
</td>
</tr>
</table>
<p align="center"> Where did you hear about us?
<select name="select" size="1">
<option selected>Please select</option>
<option>The Garden</option>
<option>Country Living</option>
<option>Homes & Gardens</option>
<option>House & Gardens</option>
<option>The English Garden</option>
<option>Country Homes & Interiors</option>
<option>Ideal Homes</option>
<option>Internet/Web Search</option>
<option>Other</option>
</select>
</p>
<p align="center">
<input type="radio" name="radiobutton" value="radiobutton">
Brochure
<input type="radio" name="radiobutton" value="radiobutton">
Consultation </p>
<p align="center">
<input type="submit" name="submit" value="Submit">
<input type="reset" name="reset" value="Reset">
</p>
</form>
When I submit the form it just keeps coming up with errors like: Server 500, or 404 Cant find form.
Any ideas anyone on whats going wrong? Im stumped.
Thanks
James