title: php post data is always empty
body: <p>i am trying to send myself an email message using jquery and php
  i want the contents of the message to be decided by jquery
  this is my sending code</p>
  
  <pre><code>$.ajax({
                      url: 'http://mywebpage.com/email.php',
                      type: 'POST',
                      contentType: 'application/json; charset=utf-8',
                      data:'test',
                      dataType: "text",
                      success: function(data){
                      console.log(data);
                          console.log("IT WORKED");
                      },
                      failure: function(result){
                          console.log("FAILED");
                          console.log(result);
                      }
                  });
  </code></pre>
  
  <p>this is my php script</p>
  
  <pre><code>&lt;?php
  header('Access-Control-Allow-Origin: *');
  header('Access-Control-Allow-Methods: POST, GET, OPTIONS');
  header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept");
  $to = "myemail@gmail.com";
  $subject = "Test mail";
  $message = $_POST["data"];
  echo var_dump($_POST);
  echo $message;
  $from = "someonelse@example.com";
  $headers = "From:" . $from;
  mail($to,$subject,$message,$headers);
  echo "Mail Sent.";
  ?&gt;
  </code></pre>
  
  <p>the email gets sent, but the $_POST["data"] always comes back empty
  what to do ?</p>