PHP form submission error - may be down or configured incorrectly HTTP Error 500

  I have a PHP form that is not functioning properly. When I submit the completed form I get the following error:
The website encountered an error while retrieving It may be down for maintenance or configured incorrectly.
Here are some suggestions:
Reload this webpage later.
HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.

Here is the code from the page that validates and sends the form:
if(isset($_POST['email'])) {
    $email_to = "";
    $email_subject = "Commission Verification";
    function died($error) {
        // your error code can go here
        echo "We are very sorry, but there were error(s) found with the form you submitted. ";
        echo "These errors appear below.<br /><br />";
        echo $error."<br /><br />";
        echo "Please go back and fix these errors.<br /><br />";
    // validation expected data exists
    if(!isset($_POST['office']) ||
        !isset($_POST['address']) ||
        !isset($_POST['city']) ||
        !isset($_POST['state']) ||
		!isset($_POST['zipcode']) ||
        !isset($_POST['lgrosscomm']) ||
		!isset($_POST['lfixedcomm']) ||
        !isset($_POST['lbonus']) ||
        !isset($_POST['ltotal']) ||
        !isset($_POST['sgrosscomm']) ||
		!isset($_POST['sfixedcomm']) ||
        !isset($_POST['sbonus']) ||
        !isset($_POST['stotal']) ||
		!isset($_POST['total']) ||
        !isset($_POST['comments']) ||
        !isset($_POST['submitby']) ||
        !isset($_POST['email'])) {
        died('We are sorry, but there appears to be a problem with the form you submitted.');       
    $office = $_POST['office']; // required
    $address = $_POST['address']; // required
    $city = $_POST['city'];//required
	$state = $_POST['state']//required
	$zip = $_POST['zipcode']//required
    $total = $_POST['total']; //required
    $comments = $_POST['comments']; // required
	$submitted_by = $_POST['submitby']; // required	
    $email_from = $_POST['email']; // required
    $error_message = "";
    $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
  if(!preg_match($email_exp,$email_from)) {
    $error_message .= 'The Email Address you entered does not appear to be valid.<br />';
    $string_exp = "/^[A-Za-z .'-]+$/";
  if(!preg_match($string_exp,$submitted_by)) {
    $error_message .= 'The Submitted By Name you entered does not appear to be valid.<br />';
  if(strlen($comments) < 2) {
    $error_message .= 'The Comments you entered do not appear to be valid.<br />';
  if(strlen($error_message) > 0) {
    $email_message = "Form details below.\n\n";
    function clean_string($string) {
      $bad = array("content-type","bcc:","to:","cc:","href");
      return str_replace($bad,"",$string);
    $email_message .= "Submitted By: ".clean_string($submitted_by)."\n";
    $email_message .= "Email: ".clean_string($email_from)."\n";
    $email_message .= "Comments: ".clean_string($comments)."\n";
// create email headers
$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
'X-Mailer: PHP/' . phpversion();
@mail($email_to, $email_subject, $email_message, $headers);  
<!-- include your own success html here -->
Thank you for contacting us. We will be in touch with you very soon.

Open in new window

I cannot figure out what is wrong with this form. Thanks in advance for your assistance.

Here is the code from the form page in case you need to see it.
<h3>Commission Verification Form</h3>
<form name="commverify" method="post" action="send_form_email.php">
<table align="center">

<tr bgcolor="#007AC2" align="center"><td colspan="10">Please complete this form after closing to receive agent commision check.</td></tr>

Date</td><td><input id="date" name="date" />  <script type="text/javascript">   document.getElementById('date').value = Date(); </script> </td></tr>

    <tr><td>Office Number </td>
	<td><input type="text" name="office" size="5" /></td></tr>
	<td><input type="text" name="address" size="12" /></td></tr>
	<td><input type="text" name="city" size="12" /></td></tr>
	<td><input type="text" name="state" size="12" /></td></tr>
     <tr><td>Zip Code</td>
	<td><input type="text" name="zipcode" size="12" /></td></tr>
	<td>Sale Price Change?</td>
	<td>Yes<input type="checkbox" value="yes" name="priceyes">No<input type="checkbox" value="no" name="priceno"></td></tr>
    <td>Title Company $ Rec'd</td>
    <td><input type="text" name="title_co" size="12" /></td></tr>
	<td>EMD on File</td>
	<td>Yes<input type="checkbox" value="yes" name="emdyes">No<input type="checkbox" value="no" name="emdno"></td></tr>
	<td>Ref pd @ Close:$</td>
	<td><input type="text" name="ref" size="12" /></td></tr>
     <tr><td>203 Revised?</td>
	<td><select Name="revised">
                                 	<option value=""></option>
<option value="Yes">Yes</option>
<option value="No">No</option></select></tr>
    <tr bgcolor="#007AC2" align="center">
      <td colspan="10">Enter REO Commission(s) and Bonus**(no commas please)</td></tr>
     <tr><td>REO list gross commission</td>
	<td><input type="text" name="lgrosscomm" size="25" maxlength="50" /></td></tr>
    <tr><td>REO list fixed commission</td>
	<td><input type="text" name="lfixedcomm" size="25" maxlength="50" /></td></tr>
    <tr><td>REO list bonus</td>
	<td><input type="text" name="lbonus" size="25" maxlength="50" /></td></tr>
     <tr><td>REO List Total</td>
	<td><input type="text" name="ltotal" size="25" maxlength="50" /></td></tr>
    <tr><td>REO sale gross commissione</td>
	<td><input type="text" name="sgrosscomm" size="25" maxlength="50" /></td></tr>
    <tr><td>REO sale fixed commission</td>
	<td><input type="text" name="sfixedcomm" size="25" maxlength="50" /></td></tr>
    <tr><td>REO sale bonus</td>
	<td><input type="text" name="sbonus" size="25" maxlength="50" /></td></tr>
    <tr><td>REO Sale Total</td>
	<td><input type="text" name="stotal" size="25" maxlength="50" /></td></tr>
    <tr><td>Combined Total</td>
	<td><input type="text" name="total" size="25" maxlength="50" /></td></tr>
    <tr><td>Does the mortgage company on the HUD (page 1 box F) match the mortgage company originally entered on the 203?</td>
    <<td><select Name="morgage">
                                 	<option value=""></option>
<option value="Yes">Yes</option>
<option value="No">No</option></select></td></tr>
    <tr><td>If No, select mortgage company from the list.</td>
    <td><select Name="financing">
                                 	<option value=""></option>
<option value="Cash">Cash</option>
<option value="Land Contract">Land Contract</option>
<option value="John Adams Mortgage Company">John Adams Mortgage Company</option>
<option value="1st Security Mortgage">1st Security Mortgage</option>
<option value="A Best Financial Corp">A Best Financial Corp</option>
<option value="Academy Mortgage Co">Academy Mortgage Co</option>
<option value="Acceptance Capital Mortgage">Acceptance Capital Mortgage</option>
<option value="Acceptance Capital Mortgage">Acceptance Capital Mortgage</option>
<option value="ACME">ACME</option>
<option value="Advantage Mortgage Company">Advantage Mortgage Company</option>
<option value="Advisory Mortgage">Advisory Mortgage</option>
<option value="Aires Mortgage Solutions">Aires Mortgage Solutions</option>
<option value="Alden State Bank">Alden State Bank</option>
<option value="Alliant Credit Union">Alliant Credit Union</option>
<option value="Ally">Ally</option>
<option value="Allyson Hometown Mortgage">Allyson Hometown Mortgage</option>
<option value="AlRes Mortgage Solutions">AlRes Mortgage Solutions</option>
<option value="Amera Mortgage">Amera Mortgage</option>
<option value="American Financial">American Financial</option>
<option value="American Internet Mortgage Inc">American Internet Mortgage Inc</option>
<option value="American Southwest Mortgage">American Southwest Mortgage</option>
<option value="Americu Mortgage">Americu Mortgage</option>
<option value="Amerifirst Financial">Amerifirst Financial</option>
<option value="AmeriPlus Mortgage">AmeriPlus Mortgage</option>
<option value="Ameriprise Financial">Ameriprise Financial</option>
<option value="Anderson Financial">Anderson Financial</option>
<option value="Ann Arbor Bank">Ann Arbor Bank</option>
<option value="Ann Arbor Mortgage">Ann Arbor Mortgage</option>
<option value="Ann Arbor State Bank">Ann Arbor State Bank</option>
<option value="Apex Funding">Apex Funding</option>
<option value="Appex Financial Solutions">Appex Financial Solutions</option>
<option value="Approved Mortgages">Approved Mortgages</option>
<option value="Arbor Mortgage">Arbor Mortgage</option>
<option value="Aspire Lending">Aspire Lending</option>
<option value="Asset One Mortgage">Asset One Mortgage</option>
<option value="Atlantis Mortgage">Atlantis Mortgage</option>
<option value="B of I Federal Bank">B of I Federal Bank</option>
<option value="Bank of America">Bank of America</option>
<option value="Bank of Ann Arbor">Bank of Ann Arbor</option>
<option value="Bank of Michigan">Bank of Michigan</option>
<option value="Bank of Northern Michigan">Bank of Northern Michigan</option>
<option value="Bankers Home Loan">Bankers Home Loan</option>
<option value="Bankwell Mortgage">Bankwell Mortgage</option>
<option value="Bay Wind Federal CU">Bay Wind Federal CU</option>
<option value="Burns Financial">Burns Financial</option>
<option value="C4D Mortgage">C4D Mortgage</option>
<option value="Cadillac Mortgage DBA Amerifirst Financi">Cadillac Mortgage DBA Amerifirst Financi</option>
<option value="Caliber Funding">Caliber Funding</option>
<option value="Calibur Funding">Calibur Funding</option>
<option value="Cap West Mortgage">Cap West Mortgage</option>
<option value="Capital Lending Inc.">Capital Lending Inc.</option>
<option value="Capital Mortgage">Capital Mortgage</option>
<option value="Cartus Home Loans">Cartus Home Loans</option>
<option value="Cason Home Loans">Cason Home Loans</option>
<option value="CCO Mortgage">CCO Mortgage</option>
<option value="CEFCU">CEFCU</option>
<option value="Center Bank">Center Bank</option>
<option value="Century Mortgage">Century Mortgage</option>
<option value="Charlevoix State Bank">Charlevoix State Bank</option>
<option value="Charter One">Charter One</option>
<option value="Chemical Bank">Chemical Bank</option>
<option value="Christian Financial">Christian Financial</option>
<option value="Churchill Mortgage Corp">Churchill Mortgage Corp</option>
<option value="Citi Mortgage">Citi Mortgage</option>
<option value="Citibank">Citibank</option>
<option value="Citizens Bank">Citizens Bank</option>
<option value="Clearpoint Funding">Clearpoint Funding</option>
<option value="Coletaylor Mortgage">Coletaylor Mortgage</option>
<option value="Colonial Mortgage">Colonial Mortgage</option>
<option value="Comerica Bank">Comerica Bank</option>
<option value="Community Choice">Community Choice</option>
<option value="Community Financial">Community Financial</option>
<option value="Consolidated Financial Mgmt">Consolidated Financial Mgmt</option>
<option value="Construction Federal Credit Union">Construction Federal Credit Union</option>
<option value="Coop Services Credit Union">Coop Services Credit Union</option>
<option value="Cornerstone">Cornerstone</option>
<option value="Countrywide Mortgage Funding">Countrywide Mortgage Funding</option>
<option value="Credit Union One">Credit Union One</option>
<option value="Cross Country Mortgage">Cross Country Mortgage</option>
<option value="CSB Mortgage">CSB Mortgage</option>
<option value="Dearborn Federal Savings Bank">Dearborn Federal Savings Bank</option>
<option value="DFCU - Dearborn Federal Credit Union">DFCU - Dearborn Federal Credit Union</option>
<option value="Discover Home Loans">Discover Home Loans</option>
<option value="Dort Federal Credit Union">Dort Federal Credit Union</option>
<option value="Dort Federal Credit Union">Dort Federal Credit Union</option>
<option value="Dow Chemical Credit Union">Dow Chemical Credit Union</option>
<option value="Downriver Community Federal Credit Union">Downriver Community Federal Credit Union</option>
<option value="Edward Jones">Edward Jones</option>
<option value="Elga Credit Union">Elga Credit Union</option>
<option value="Elias Financial">Elias Financial</option>
<option value="Elite Mortgage">Elite Mortgage</option>
<option value="Envoy Mortgage">Envoy Mortgage</option>
<option value="Equitrust">Equitrust</option>
<option value="Exceptional Mortgage Services">Exceptional Mortgage Services</option>
<option value="Fairway Independent Mortgage">Fairway Independent Mortgage</option>
<option value="Federal Savings">Federal Savings</option>
<option value="Fifth Third Bank">Fifth Third Bank</option>
<option value="Financial Plus Credit Union">Financial Plus Credit Union</option>
<option value="First Choice Loan Services">First Choice Loan Services</option>
<option value="First Commerce Financial">First Commerce Financial</option>
<option value="First Community">First Community</option>
<option value="First Federal Bank">First Federal Bank</option>
<option value="First Merit Bank">First Merit Bank</option>
<option value="First Michigan">First Michigan</option>
<option value="First Mortgage Corp">First Mortgage Corp</option>
<option value="First National Mortgage Bankers">First National Mortgage Bankers</option>
<option value="First Place Bank">First Place Bank</option>
<option value="First Preferred">First Preferred</option>
<option value="First Republic Bank">First Republic Bank</option>
<option value="First Securities Financial Services">First Securities Financial Services</option>
<option value="First Security Mortgage">First Security Mortgage</option>
<option value="First State Bank">First State Bank</option>
<option value="Flagstar">Flagstar</option>
<option value="Fleet Financial">Fleet Financial</option>
<option value="Franklin American Mortgage">Franklin American Mortgage</option>
<option value="Front Street Mortgage">Front Street Mortgage</option>
<option value="Genisys Credit Union">Genisys Credit Union</option>
<option value="Genysis Midwest Loan Services">Genysis Midwest Loan Services</option>
<option value="GMAC">GMAC</option>
<option value="Gold Coast Bank Chicago">Gold Coast Bank Chicago</option>
<option value="Gold Star Mtg">Gold Star Mtg</option>
<option value="Good Shepherd Credit Union">Good Shepherd Credit Union</option>
<option value="Great Lakes Mortgage">Great Lakes Mortgage</option>
<option value="Great Lakes Mortgage Funding">Great Lakes Mortgage Funding</option>
<option value="Green Stone Farm Credit">Green Stone Farm Credit</option>
<option value="Greenstone Financial">Greenstone Financial</option>
<option value="Group One">Group One</option>
<option value="Guaranty Bank FSB">Guaranty Bank FSB</option>
<option value="Guardian Mortgage">Guardian Mortgage</option>
<option value="Guidance Residential">Guidance Residential</option>
<option value="Hantz Bank">Hantz Bank</option>
<option value="Harbour Mortgage">Harbour Mortgage</option>
<option value="Holly Financial">Holly Financial</option>
<option value="Home Funding Group">Home Funding Group</option>
<option value="Home Lending Solutions">Home Lending Solutions</option>
<option value="Home Loan Specialist">Home Loan Specialist</option>
<option value="Homesite Mortgage">Homesite Mortgage</option>
<option value="Homestead Mortgage">Homestead Mortgage</option>
<option value="Hometown Mortgage">Hometown Mortgage</option>
<option value="Honor Bank">Honor Bank</option>
<option value="Horizon Financial Group">Horizon Financial Group</option>
<option value="HSBC Bank">HSBC Bank</option>
<option value="Huntington Bank">Huntington Bank</option>
<option value="Huron Valley Financial">Huron Valley Financial</option>
<option value="iFreedom Direct Mortgage Services">iFreedom Direct Mortgage Services</option>
<option value="Independence Mortgage">Independence Mortgage</option>
<option value="Independent Bank">Independent Bank</option>
<option value="Independent Mortgage Co.">Independent Mortgage Co.</option>
<option value="Integra Mortgage Corp">Integra Mortgage Corp</option>
<option value="Integrity Home Loans">Integrity Home Loans</option>
<option value="Interbank Mortgage">Interbank Mortgage</option>
<option value="Intouch Credit Union">Intouch Credit Union</option>
<option value="Intouch Credit Union">Intouch Credit Union</option>
<option value="JP Morgan Chase">JP Morgan Chase</option>
<option value="Kaye Financial">Kaye Financial</option>
<option value="KEMBRA-Financial Credit Union">KEMBRA-Financial Credit Union</option>
<option value="Key Bank">Key Bank</option>
<option value="Lake Michigan Credit Union">Lake Michigan Credit Union</option>
<option value="Lakeside Mortgage">Lakeside Mortgage</option>
<option value="Level One">Level One</option>
<option value="Lighthouse Title">Lighthouse Title</option>
<option value="Livingston Community Bank">Livingston Community Bank</option>
<option value="Lotus Bank">Lotus Bank</option>
<option value="Main Street Bank">Main Street Bank</option>
<option value="Maple Mortgage">Maple Mortgage</option>
<option value="Maple Mortgage">Maple Mortgage</option>
<option value="Maroon Financial CU">Maroon Financial CU</option>
<option value="Maverick Funding">Maverick Funding</option>
<option value="Mayo Employee Fed Credit Union">Mayo Employee Fed Credit Union</option>
<option value="McLellan Financial">McLellan Financial</option>
<option value="Member First">Member First</option>
<option value="Member Mortgage Services">Member Mortgage Services</option>
<option value="Merrill Lynch">Merrill Lynch</option>
<option value="Metro Mortgage Investments LLC">Metro Mortgage Investments LLC</option>
<option value="Michigan Catholic Credit Union">Michigan Catholic Credit Union</option>
<option value="Michigan Financial Mortgage">Michigan Financial Mortgage</option>
<option value="Michigan Mutual">Michigan Mutual</option>
<option value="Michigan Schools & Government Credit Uni">Michigan Schools & Government Credit Uni</option>
<option value="Michigan United Mortgage">Michigan United Mortgage</option>
<option value="Midwest Realty Finance">Midwest Realty Finance</option>
<option value="Military Family Home Loans">Military Family Home Loans</option>
<option value="Milmar Mortgage">Milmar Mortgage</option>
<option value="Monarch Community Bank">Monarch Community Bank</option>
<option value="Monroe Bank & Trust">Monroe Bank & Trust</option>
<option value="Mortgage Capital Associates">Mortgage Capital Associates</option>
<option value="Mortgage Center">Mortgage Center</option>
<option value="Mortgage First">Mortgage First</option>
<option value="Mortgage Investors Corp">Mortgage Investors Corp</option>
<option value="Mortgage One">Mortgage One</option>
<option value="Mortgage Resources">Mortgage Resources</option>
<option value="Mortgage Services III">Mortgage Services III</option>
<option value="MSU Credit Union">MSU Credit Union</option>
<option value="Muskegon St. Joseph Federal Credit Union">Muskegon St. Joseph Federal Credit Union</option>
<option value="National Bank of Kansas">National Bank of Kansas</option>
<option value="National Funding">National Funding</option>
<option value="National Home Lending">National Home Lending</option>
<option value="Nations Direct Mortgage">Nations Direct Mortgage</option>
<option value="Nationstar Mortgage">Nationstar Mortgage</option>
<option value="Navy Federal Credit Union">Navy Federal Credit Union</option>
<option value="NCB Financial Group">NCB Financial Group</option>
<option value="New Century Mortgage Financial">New Century Mortgage Financial</option>
<option value="Northwest Federal Credit Union">Northwest Federal Credit Union</option>
<option value="Northwestern Bank">Northwestern Bank</option>
<option value="Northwestern Mortgage">Northwestern Mortgage</option>
<option value="Nucompass Mortgage">Nucompass Mortgage</option>
<option value="NYCB Mortgage Co">NYCB Mortgage Co</option>
<option value="Oakland County Credit Union">Oakland County Credit Union</option>
<option value="OTHER">OTHER</option>
<option value="PAC Federal Credit Union">PAC Federal Credit Union</option>
<option value="Pierpoint Mtg">Pierpoint Mtg</option>
<option value="PLB Lending">PLB Lending</option>
<option value="PNC Bank">PNC Bank</option>
<option value="Polaris Home Funding">Polaris Home Funding</option>
<option value="Preferred Mortgage">Preferred Mortgage</option>
<option value="Premia Mortgage">Premia Mortgage</option>
<option value="Premier Mortgage">Premier Mortgage</option>
<option value="Prime Lending">Prime Lending</option>
<option value="Provident Funding">Provident Funding</option>
<option value="Pulte Mortgage">Pulte Mortgage</option>
<option value="Quicken Loans">Quicken Loans</option>
<option value="RBS Citizens">RBS Citizens</option>
<option value="Real Estate Mortgage">Real Estate Mortgage</option>
<option value="Reliance Financial">Reliance Financial</option>
<option value="REMN">REMN</option>
<option value="Resource Mortgage">Resource Mortgage</option>
<option value="Ross Mortgage">Ross Mortgage</option>
<option value="Savage & Associates">Savage & Associates</option>
<option value="Security Mortgage Corporation">Security Mortgage Corporation</option>
<option value="Select Investors">Select Investors</option>
<option value="Sentrax">Sentrax</option>
<option value="Shelter Mortgage">Shelter Mortgage</option>
<option value="Shore Financial">Shore Financial</option>
<option value="Sierra Pacific Mortgage">Sierra Pacific Mortgage</option>
<option value="Sirva Mortgage">Sirva Mortgage</option>
<option value="Sistar Mortgage">Sistar Mortgage</option>
<option value="Somerset Lending">Somerset Lending</option>
<option value="Southwest Housing">Southwest Housing</option>
<option value="St. James Mortgage">St. James Mortgage</option>
<option value="Star Mortgage">Star Mortgage</option>
<option value="State Farm">State Farm</option>
<option value="State Savings Bank">State Savings Bank</option>
<option value="Stifel Bank & Trust">Stifel Bank & Trust</option>
<option value="Success Mortgage">Success Mortgage</option>
<option value="Summit Community Bank">Summit Community Bank</option>
<option value="Summit Funding">Summit Funding</option>
<option value="Talmer Bank and Trust">Talmer Bank and Trust</option>
<option value="TBI Mortgage">TBI Mortgage</option>
<option value="TCF Bank">TCF Bank</option>
<option value="Telcom Credit Union">Telcom Credit Union</option>
<option value="Telecom Credit Union">Telecom Credit Union</option>
<option value="TG Group">TG Group</option>
<option value="The Private Bank and Trust">The Private Bank and Trust</option>
<option value="Title Source">Title Source</option>
<option value="Top Flite Financial">Top Flite Financial</option>
<option value="Towne Mortgage Co">Towne Mortgage Co</option>
<option value="Traverse City State Bank">Traverse City State Bank</option>
<option value="Trust Financial Home Lending">Trust Financial Home Lending</option>
<option value="U of M Credit Union">U of M Credit Union</option>
<option value="UBS">UBS</option>
<option value="United Bank and Trust">United Bank and Trust</option>
<option value="United Mortgage">United Mortgage</option>
<option value="United Wholesale Mortgage">United Wholesale Mortgage</option>
<option value="Universal Lending Group">Universal Lending Group</option>
<option value="University Bank of Ann Arbor">University Bank of Ann Arbor</option>
<option value="University Lending">University Lending</option>
<option value="US Bank">US Bank</option>
<option value="US Bank National Assoc">US Bank National Assoc</option>
<option value="USAA Federal">USAA Federal</option>
<option value="USDA Rural Development">USDA Rural Development</option>
<option value="Vacation Finance">Vacation Finance</option>
<option value="Vandyk Mortgage">Vandyk Mortgage</option>
<option value="Versatile Mortgage">Versatile Mortgage</option>
<option value="Veterans United">Veterans United</option>
<option value="Vista Team">Vista Team</option>
<option value="Wall Street Lending Corp">Wall Street Lending Corp</option>
<option value="Watson Group Financial">Watson Group Financial</option>
<option value="Wells Fargo">Wells Fargo</option>
<option value="Wildfire Credit Union">Wildfire Credit Union</option>
<option value="Zana Financial">Zana Financial</option>
<option value="Zenith Mortgage">Zenith Mortgage</option>

    <tr><td>If &quot;OTHER&quot; enter name</td>
    <td><input type="text" name="mocomp" size="25" maxlength="50"></td></tr>
    <tr><td>Does the transaction type on the 203 match the transaction type on the HUD-1?</td>
    <td><select Name="transmatch">
                                 	<option value=""></option>
<option value="Yes">Yes</option>
<option value="No">No</option></select></td></tr>
    <tr><td>If &quot;NO&quot; select the correct transaction type</td>
    <td><select name="trans_type">
                            	<option value=""></option>
                            	<option value="Bank">Bank</option>
                                <option value="HUD">HUD</option>
                                <option value="Short Sale">Short Sale</option>
                                <option value="Traditional">Traditional</option>
                                <option value="Lease">Lease</option>
                                <option value="Commercial">Commercial</option>
                                <option value="Vacant Land">Vacant Land</option>
                                <option value="New Construction">New Construction</option>
    <td><input type="text" name="comments" size="50" maxlength="500"></td></tr>
    <tr><td>Submitted By:</td><td><input type="text" name="submitby" size="20" maxlength="30"></td></tr>
    <tr><td>Email:</td><td><input type="text" name="email" size="20" maxlength="30"></td></tr>
    <tr><td><input type="submit" value="Send" /><input type="reset" value="Clear" /></td></tr>

Open in new window

Who is Participating?

Improve company productivity with a Business Account.Sign Up

Dave BaldwinConnect With a Mentor Fixer of ProblemsCommented:
He's probably on IIS without 'send errors to browser' set up.  Below is my email demo that works on Apache and IIS and on many hosts.  Save it as 'Email.php' so it can post to itself and change the $toText below to your own email address.

# some settings of POST vars
if (!isset($_POST['send']))  $send = ''; else $send = $_POST['send'];
if (!isset($_POST['subjectText'])) $subjectText = ''; else $subjectText = $_POST['subjectText'];
if (!isset($_POST['msgText'])) $msgText = ''; else $msgText = $_POST['msgText'];
if (!isset($_POST['ccText'])) $ccText = ''; else $ccText = $_POST['ccText'];
if (!isset($_POST['bccText'])) $bccText = ''; else $bccText = $_POST['bccText'];
if (!isset($_POST['nameText'])) $nameText = ''; else $nameText = $_POST['nameText'];
if (!isset($_POST['fromText'])) $fromText = ''; else $fromText = $_POST['fromText'];

if ($send == "") {
    $title="Test Email Page";
else {
	if($fromText === "") die("No name!");
	$title="Test Email Page";
  $announce="Your Message has been Sent!";
	$header = "From: ".$fromText."\r\n";
//	$header .= "Cc: ".$ccText."\n";
	$header .= "Reply-To : ".$fromText."\r\n";
	$header .= "Return-Path : ".$fromText."\r\n";
	$header .= "X-Mailer: PHP\r\n";
	$header .= "MIME-Version: 1.0\r\n";
	$header .= "Content-Type: text/plain; charset=iso-8859-1\r\n";
//	ini_set(sendmail_from,$fromText);  
	mail($toText, $subjectText, $msgText, $header, '-f'.$fromText);
//	ini_restore(sendmail_from);
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title><?php echo($title)?></title>
<style type="text/css">
A:link { color: #999999; }
A:visited { color: #999999; }
A:hover {color: #0099ff;}
<script type="text/javascript">
function check()
var at=document.getElementById("fromText").value.indexOf("@");
var eml=document.getElementById("fromText").value;
var nam=document.getElementById("nameText").value;
var alerttxt="";
var submitOK="true";

if (eml.length < 5 || at == -1)
    alerttxt=alerttxt+"Please enter a valid e-mail address!\r\n";
    //return false;
if (nam.length < 3)
    alerttxt=alerttxt+"Please enter your name.\r\n";
    //return false;
if (submitOK=="false")
    return false;

// -->

<body bgcolor="#ddeedd">
<div align="center">
<table border="0" cellpadding="0" cellspacing="0" summary="" width="580">
<tr><td align="center">

if ($send != "") {
   	echo ("To: ".$toText."<br>\r\nSubject: ".$subjectText."<br>\r\n".$msgText."<br>\r\n".$header);

<p><b><font color="#000000" size="5">Test Email</font></b></p>
<font size="4" color="#000000">

<form method="POST" action="Email.php" onsubmit="return check();">
    <p><font size="3"><b>Name: <input type="text" name="nameText" id="nameText" size="46"></b></font></p>
    <p><font size="3"><b>Email: <input type="text" name="fromText" id="fromText" size="46"></b></font></p>
    <input type="hidden" name="subjectText" value="Web Mail">
    <p><font face="Arial" size="3"><b>Message Text:</b></font></p>
    <p><font face="Arial" size="3"><b><textarea rows="6" name="msgText" cols="60"></textarea></b></font></p>
    <p><font size="3"><b><input type="submit" value="Send" name="send" style="font-family: Arial; font-size: 12pt; font-weight: bold"></b></font></p>
    <input type="hidden" name="state" value="1">
  <b><font face="Arial" size="4" color="#e00000"><?php echo($announce)?></font></b><br><br>



Open in new window

Greg AlexanderConnect With a Mentor Lead DeveloperCommented:
$state = $_POST['state']//required
$zip = $_POST['zipcode']//required

Open in new window

needs ending semicolons
$state = $_POST['state'];//required
$zip = $_POST['zipcode'];//required

Open in new window

And you need to remove the ending } after

if(!preg_match($string_exp,$submitted_by)) {
    $error_message .= 'The Submitted By Name you entered does not appear to be valid.<br />';

Open in new window

The next one after that
jdinesAuthor Commented:
Thanks, I corrected those errors but I am still getting the same error. I will go through to look for any additional typos.
Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

Ray PaseurConnect With a Mentor Commented:
Who is your hosting company?  A 500 server error should not occur as a result of a PHP parse error.  You should be able to add these lines to the very top of your PHP script and get useful diagnostic information:

ini_set('display_errors', TRUE);

If you add those and you do not get good information about the error, you might consider moving your site to a more professional hosting company.  I use and can recommend for their great tech support.  I have also had good experiences with BlueHost, DreamHost, SliceHost, HostGator and LiquidWeb.  I have not had good experiences with GoDaddy or SiteGround.

Please post back and let us know if the errors begin to display, thanks. ~Ray
jdinesAuthor Commented:
Thank you, this helped me to find the issue.
Ray PaseurCommented:
If the responses helped you find the issue, why did you give a bad grade?

What were you expecting?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.