Email form not working

Discussion in 'JavaScript' started by Dazed&Confused, Oct 18, 2007.

  1. #1
    I am having trouble with a registration form not being sent to an email address. We have checked out the email itself and it does not seem to be a problem. The submit registration button doesn't send the form to the email address. In addition, the "thanks for sending in your form" page does not appear after the button has been clicked. Forgive my ignorance, I am not a programmer, and did not write this code or design the site. I am trying to help out a client. Here is the code from the form page itself...

    <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Untitled Document</title>
    <link href="styles/ridgestyles.css" rel="stylesheet" type="text/css">
    <style type="text/css">
    <!--
    body {
    	background-image: url();
    }
    -->
    </style>
    </head>
    
    <body class="horse_watermark">
    <table width="483" border="0" cellpadding="0" cellspacing="3">
      <tr align="left">
        <td valign="top"><p align="center" class="bodyheader1"> <strong> Entry Form<br>
        </strong><em><strong>Schooling Shows</strong></em></p>
        	<p align="center"> Show Date:  Saturday October 20th and November 17th 2007<br>
           	</p>
        	</td>
      </tr>
      <tr>
        <td align="center" valign="top">    	<!-- mailto:productions@penneycooper.ca?subject=Knowlton Ridge Schooling Shows Entry --><form action="send_registration.asp" method="post" name="Entry" id="Entry" onClick="calculate();">
        		<table width="100%" cellpadding="3" cellspacing="0">
                	<tr>
                		<td width="105" valign="top"><p> Rider Name : </p></td>
                		<td width="382" valign="top"><p>
                			<input name="Rider's Name" type="text" class="text" id="Rider's Name">
                		</p></td>
                		</tr>
                	<tr>
                		<td width="105" valign="top"><p> Horse Name: </p></td>
                		<td width="382" valign="top"><p>
                			<input name="Horse's Name" type="text" class="text" id="Horse's Name">
                		</p></td>
                		</tr>
                	<tr>
                		<td width="105" valign="top"><p> Rider Number: </p></td>
                		<td width="382" valign="top"><p>
                			<input name="Rider's Number" type="text" class="text" id="Rider's Number">
                		</p></td>
                		</tr>
                	<tr>
                		<td width="105" valign="top"><p> Mailing Address: </p></td>
                		<td width="382" valign="top"><p>
                			<input name="Mailing Address" type="text" class="text" id="Mailing Address">
                		</p></td>
                		</tr>
                	<tr>
                		<td width="105" valign="top"><p> Email Address: </p></td>
                		<td width="382" valign="top"><p>
                			<input name="Email Address" type="text" class="text" id="Email Address">
                		</p></td>
                		</tr>
                	<tr>
                		<td width="105" valign="top"><p> Telephone #: </p></td>
                		<td width="382" valign="top"><p>
                			<input name="Telephone Number" type="text" class="text" id="Telephone Number">
                		</p></td>
                		</tr>
                	</table>
       		    <table width="100%" cellpadding="3" cellspacing="0">
       		    	<tr>
                    	<td valign="top"><p> Individual Class #&rsquo;s Entered (see class list):
                    		<input name="Class Numbers" type="text" class="text" id="Class Numbers">
                    	</p></td>
                    	<td valign="top"><p> Fee: $
                    		<input name="Class Fee" type="text" id="ClassFee" size="10" maxlength="6">
                    	</p></td>
       		    		</tr>
       		    	<tr>
                    	<td valign="top"><p> Division(s) Entered (see class list):
                    		<input name="Division Numbers" type="text" class="text" id="Division Numbers">
                    	</p></td>
                    	<td valign="top"><p> Fee: $
                    		<input name="Division Fee" type="text" id="DivisionFee" size="10" maxlength="6">
                    	</p></td>
       		    		</tr>
       		    	<tr>
                    	<td valign="top"><p> Early Entry Discount: $5 if <strong>entered and paid </strong>one week prior to show:</p></td>
       		    		<td valign="top">Fee: $
                            <input name="Early Discount" type="text" id="EarlyDiscount" size="10" maxlength="6"></td>
       		    	</tr>
                	<tr>
                		<td width="378" valign="top"><p> Stall Booking:
                			<input name="Stall Days" type="text" id="StallDays" value="0" size="3" maxlength="1"> 
                			$20.00 per day 
                			<input name="Stall Nights" type="text" id="StallNights" value="0" size="3" maxlength="1">
                			$30.00 overnight<br>
                			(state number if stalls)</p></td>
                		<td width="109" valign="top"><p> Fee: $
                			<input name="Stall Fee" type="text" id="StallFee" size="10" maxlength="6">
                		</p></td>
                		</tr>
                	<tr>
                		<td width="378" valign="top"><p> Horse Rental: $25.00</p></td>
                		<td width="109" valign="top"><p> Fee: $
                			<input name="Horse Fee" type="text" id="HorseFee" size="10" maxlength="6">
                		</p></td>
                		</tr>
                	<tr>
                		<td width="378" valign="top"><p> Total Entries</p></td>
                		<td width="109" valign="top"><p> Fee: $
                			<input name="Total Entries" type="text" id="TotalEntries" size="10" maxlength="6">
                		</p></td>
                		</tr>
                	<tr>
                		<td width="378" valign="top"><p> Number Fee (refundable upon return) </p></td>
                		<td width="109" valign="top"><p> Fee: $2.00</p></td>
                		</tr>
                	<tr>
                		<td width="378" valign="top"><p> Administration Fee</p></td>
                		<td width="109" valign="top"><p> Fee $3.00</p></td>
                		</tr>
                	<tr>
                		<td width="378" valign="top"><p> Sub Total Payable to Knowlton Ridge</p></td>
                		<td width="109" valign="top"><p> Fee $
                			<input name="subtotal" type="text" id="subtotal" size="10" maxlength="6">
                		</p></td>
                		</tr>
                	<tr>
                		<td align="right" valign="middle">  GST (6%) </td>
                		<td>GST $
                            <input name="gst" type="text" id="gst" size="10" maxlength="6"></td>
                		</tr>
                	<tr>
                    	<td valign="top"><p> Total Payable to Knowlton Ridge at event
    
    
    (inc. GST)
    
    </p></td>
                    	<td valign="top"><p> Fee $
                            			<input name="total" type="text" id="total" size="10" maxlength="6">
                    			</p></td>
                		</tr>
                	<tr align="center">
                		<td colspan="2" valign="top"><input type="submit" name="Submit" value="Send Registration"></td>
                		</tr>
                	</table>
        </form></td>
      </tr>
      <tr>
        <td align="center" valign="top">Make cheques out to <strong>Knowlton Ridge Equestrian Centre</strong>.</td>
      </tr>
      <tr>
        <td align="center" valign="top"><p align="center"> Knowlton Ridge Equestrian Centre <br>
        	204 Main St N ,  Powassan ,  ON P0H 1Z0<br>
        	phone : 724-1313 fax: 724-6018<br>
        	email: <a href="mailto:info@knowltonridgeequestrian.ca">info@knowltonridgeequestrian.ca</a></p>
        	</td>
      </tr>
    </table>
    </body>
    </html>
    
    PHP:
    Here is the code from the page that is supposed to appear after the form has been sent...

    <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
    <%
    security = request.ServerVariables("HTTP_REFERER")
    If (security<> "http://www.knowltonridgeequestrian.com/school_registration.asp") Then
    response.Redirect("school_registration.asp")
    End If
    ' Get the form data
    thankyou = ""
    rname = Request.Form("Rider's Name")
    hname = Request.Form("Horse's Name")
    rnumber = Request.Form("Rider's Number")
    address = Request.Form("Mailing Address")
    email = Request.Form("Email Address")
    phone = Request.Form("Telephone Number")
    classes = Request.Form("Class Numbers")
    classfee = Request.Form("Class Fee")
    divisions = Request.Form("Division Numbers")
    divisionfee = Request.Form("Division Fee")
    discount = Request.Form("Early Discount")
    sdays = Request.Form("Stall Days")
    snights = Request.Form("Stall Nights")
    sfee = Request.Form("Stall Fee")
    hfee = Request.Form("Horse Fee")
    entries = Request.Form("Total Entries")
    subtotal = Request.Form("subtotal")
    gst = Request.Form("gst")
    total = Request.Form("total")
    subject    = "Knowlton Ridge Schooling Shows Entry - "& rname
    'recipient   = "productions@penneycooper.com"
    recipient   = "robertecardwell@sympatico.ca"
    
    
    body        = "Rider Name: " & Trim(rname) & vbCrLf _
    				& "Horse Name: " & Trim(hname) & vbCrLf _
    				& "Mailing Address: " & Trim(address) & vbCrLf _ 
    				& "E-Mail Address: " & Trim(email) & vbCrLf _ 
    				& "Phone: " & Trim(phone) & vbCrLf _ 
    				& "Classes Entered: " & Trim(classes) & vbTab & "Classes Fee: $" & Trim(classfee) & vbCrLf _ 
    				& "Divisions Entered: " & Trim(divisions) & vbTab & "Divisions Fee: $" & Trim(divisionfee) & vbCrLf _ 
    				& "Early Entry Discount: " & Trim(discount) & vbCrLf _ 
    				& "Stall Booking: " & Trim(sdays) & " Days, " & Trim(snights) & " Nights, " & vbTab & "Stall Fee: $" & Trim(sfee) & vbCrLf _ 
    				& "Horse Fee: $" & Trim(hfee) & vbCrLf _ 
    				& "Total Entries: $" & Trim(entries) & vbCrLf _ 
    				& "Sub Total: $" & Trim(subtotal) & vbCrLf _ 
    				& "+GST: $" & Trim(gst) & vbCrLf _ 
    				& "TOTAL: $" & Trim(total)
    
    Set msg = Server.CreateObject("Persits.MailSender")
    
    msg.Reset
    
    
    ' Enter the sender data
    msg.From = email
    'Response.Write "email:" & email & "<br>"
    msg.FromName = rname
    'Response.Write "rname:" & rname & "<br>"
    
    ' Note that as AddAddress is method and not
    ' a property, we do not use an equals ( = ) sign
    msg.AddAddress recipient
    'Response.Write "recipient:" & recipient & "<br>"
    
    ' The subject of the message
    msg.Subject = subject
    'Response.Write "subject:" & subject & "<br>"
    
    ' And the body
    msg.Body = body
    'Response.Write "body:" & body & "<br>"
    
    msg.Host = "10.0.0.20"
    msg.Username = "postmaster@knowltonridgeequestrian.com"
    msg.Password = "krqp123"
    IF rname <> "" AND email <> "" AND phone <> "" AND hname <> "" AND address <> "" AND Err.Number <> 0 THEN
    		On Error Resume Next 
    		if msg.Send then
    		'msg.Send
    		thankyou = rname & ", you have successfully submitted your entry. We look forward to seeing you there!"
    		end if
    		IF Err.Number = 6 THEN
    			thankyou = "Please use a valid email address.<br><a href='school_registration.asp'>Redo registration.</a>"
    		END IF
    
    	ELSE
    
    	
    	Response.Write "<h2><a href='school_registration.asp'>Please click here and complete the following fields:</a></h2>"
    	IF rname = "" THEN
    		Response.Write "<b>• Rider Name</b><br>"
    	END IF
    	IF hname = "" THEN
    		Response.Write "<b>• Horse Name</b><br>"
    	END IF
    	IF address = "" THEN
    		Response.Write "<b>• Address</b><br>"
    	END IF
    	IF email = "" THEN
    		Response.Write "<b>• Email</b><br>"
    	END IF
    	IF phone = "" THEN
    		Response.Write "<b>• Phone</b><br>"
    	END IF
    END IF
    
    
    %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Untitled Document</title>
    <link href="styles/ridgestyles.css" rel="stylesheet" type="text/css" />
    </head>
    
    <body>
    <table width="100%" height="100%"  border="0" cellpadding="20" cellspacing="0">
    	<tr>
    		<td align="center" valign="middle"><h2 align="center"><%= thankyou %></h2>
    		<h3 align="center"><a href="capabilities.asp">Return to Shows &amp; Events</a></h3></td>
    	</tr>
    </table>
    </body>
    </html>
    <% 
    	Set msg = Nothing
    
     %>
    PHP:
    Any idea why this isn't working? Thanks guys!
     
    Dazed&Confused, Oct 18, 2007 IP
  2. Martens

    Martens Peon

    Messages:
    126
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Have same problem:(Please help semeone:eek:
     
    Martens, Oct 22, 2007 IP