形式信息从形式不发送

Below is the HTML for the form im using.

<form action= "<?php echo get_template_directory_uri() . '/sendmail.php'; ?>" method="POST" id="contactForm">

    <div class="row alignleft infieldlabel">
        <p class="form_label">Name</p>
        <input type="text" id="name" name="yourname" value="" class="inputtext input_middle required">
    </div>

    <div class="space"></div>

    <div class="row alignleft infieldlabel">
        <p class="form_label">Email</p>
        <input type="text" id="email" name="email" value="" class="inputtext input_middle required">
    </div>

    <div class="clear"></div> 
    <p class="form_label">Select Subject</p>
    <div class="styled-select">
        <select id="subject">
            <option>Personal Injury</option>
            <option>Wrongful Death</option>
            <option>Litigation</option>
        </select>
    </div>  

    <div class="clear"></div>   

    <div class="row infieldlabel">
        <p class="form_label"><?php echo $eto_options["eto_textinput"];?></p>
        <textarea id="message" cols="30" rows="10" name="message" class="textarea textarea_middle required"></textarea>
    </div>

    <div class="row rowSubmit">
        <input type="submit" id="send" value="Send" class="contact_btnsubmit">                                
    </div>
</form>

Im using the following script to try and send the information. The email is just an example, in the actual use I had a correct email address.

$email = $_POST['mail@example.com']; 

$to = $email; // email to send to...
$subject = $_POST["subject"];
$message = $_POST["message"];
$headers = 'From:' $_POST["email"] . "
" .
    'Reply-To: Reply to email' . "
" .
    'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);
?>

Also i should note that when i hit the submit button on my form nothing happens, the page doesn't load or anything. Also this is in wordpress thus the random bit of php in the html.

The problem was in the headers which threw me an error.

Your headers which contain Reply-To: Reply to <= 2x Reply statements

$headers = 'From:' $_POST["email"] . "
" .
'Reply-To: Reply to email' . "
" .
'X-Mailer: PHP/' . phpversion();

Gave me the following error:

Parse error: syntax error, unexpected '$_POST' (T_VARIABLE) in...

Here is working code while using this in my test form:

<form action= "sendmail.php" method="POST" id="contactForm">

PHP

<?php

$email = $_POST['email']; 
$to = "email@example.com";
$subject = $_POST["subject"];
$message = $_POST["message"];
$headers = "From: $email" . "
" .
"Reply-To: $email" . "
" .
"X-Mailer: PHP/" . phpversion();
mail($to, $subject, $message, $headers);

?>

FORM USED

NOTE: I changed <select id="subject"> to <select id="subject" name="subject">

That way, it will show up as the subject in your email which was not present in your form.

<form action= "sendmail.php" method="POST" id="contactForm">

<div class="row alignleft infieldlabel">
    <p class="form_label">Name</p>
    <input type="text" id="name" name="yourname" value="" class="inputtext input_middle required">
</div>

<div class="space"></div>

<div class="row alignleft infieldlabel">
    <p class="form_label">Email</p>
    <input type="text" id="email" name="email" value="" class="inputtext input_middle required">
</div>

<div class="clear"></div> 
 <p class="form_label">Select Subject</p>
<div class="styled-select">
    <select id="subject" name="subject">
       <option>Personal Injury</option>
       <option>Wrongful Death</option>
       <option>Litigation</option>
    </select>

</div>  


<div class="clear"></div>   

<div class="row infieldlabel">
   <p class="form_label"><?php echo $eto_options["eto_textinput"];?></p>
    <textarea id="message" cols="30" rows="10" name="message" class="textarea textarea_middle required"></textarea>
</div>

<div class="row rowSubmit">
<input type="submit" id="send" value="Send" class="contact_btnsubmit">                                

</div>
</form>

first try with following basic option and let me know whether this is working. copy paste this following code to your page.

<form action= "<?php echo get_template_directory_uri() . '/sendmail.php'; ?>" method="POST" id="contactForm">
    Test value:<input type="text" name="test_box" />
    <input type="submit" id="send" value="Send" class="contact_btnsubmit">
</form>