Hello programming 'gods' ;)
First off, I've never planned on being a programmer, and here is why:
I'm trying to make a contact form with ASPEmail. The current server I am on does not support CDONTS & CDOSYS since there's a major glitch in the Win2003 SP1 software.
First, here is where the contact form is:
http://eyeimagination.us/marblegrani...contact_us.asp
It references to the form below. It works, but there's two major things wrong with it:
1. The error code does not work. That is why I'm using a form validation system.
2. I want to be able to add "telephone", "Street Address", and "City, State & Zip" fields.
I AM BEGGING! PLEASE HELP A DESIGNER OUT! Thank you in advance.
Code:
<%
'Brian, this is the part where it requests the values from the form...notice the names match the
'field names from the form page
Name = Request.Form("Name")
Telephone = Request.Form("Telephone")
StreetAddress = Request.Form("StreetAddress")
CityStateZip = Request.Form("CityStateZip")
Email = Request.Form("Email")
Inquiry = Request.Form("Inquiry")
'Brian, new form types you asked for dropdown, radio and checkbox, notice the treatment of the
'checkbox...its the only kind that acts different. on the html page I set the checked value to mean
'Yes and in this page I'm saying if it isn't equal to yes then it must be no. Because an unchecked
'box will come thru as blank.
'Brian, this builds the body of the email
body = "Name: " & Name & "
"
body = body & "Telephone: " & Telephone & "
"
body = body & "Street Address: " & StreetAddress & "
"
body = body & "City,State and Zip: " & CityStateZip & "
"
body = body & "Email: " & Email & "
"
body = body & "Inquiry: " & Inquiry & "
"
Set Mail = Server.CreateObject("Persits.MailSender")
' enter valid SMTP host
Mail.Host = "mail.cybercastmedia.com"
Mail.From = Request("Email") ' From address
Mail.FromName = Request("Name")
Mail.AddAddress "brian.zajac@3das.com", "Brian Zajac"
' message subject
Mail.Subject = "Inquiry From the Marble Granite Direct Website - marblegranitedirect.com"
' message body
Mail.Body = Request("Inquiry")
strErr = ""
bSuccess = False
On Error Resume Next ' catch errors
Mail.Send ' send message
If Err <> 0 Then ' error occurred
strErr = Err.Description
else
bSuccess = True
End If
%>
<HTML>
<BODY BGCOLOR="#FFFFFF">
<% If strErr <> "" Then %>
<h3>Error occurred: <% = strErr %>. Please click your browser's back button and correctly fill out our form. Thank you.
<% End If %>
<% If bSuccess Then %>
Thank you for filling out our form <% = Request("Email") %>. Click HERE to return to our home page.
<% End If %>
</body>
</html>