Contact Form is not sending all info

Contact Form is not sending all info

Contact Form info is not sending from my PHP/jQuery contact form, only 
name: 
email:

Here's the code:
<form id="ajax-contact" method="post">
  1. <table class="table10">
  2. <tr>
  3. <td>
  4. <label for="name">Your Name:</label>
  5. <input id="contact-name" type="text" name="name" required>
  6. </td>
  7. </tr>
  8. </tr>
  9. <tr>
  10. <td>
  11. <label for="email">Your Email Address:</label>
  12. <input id="contact-email" type="email" name="email" required>
  13. </td>
  14. </tr>
  15. <tr>
  16. <td>
  17. <label for="message">Message:</label>
  18. <textarea id="contact-message" type="text" name="message" required></textarea>
  19. </td>
  20. </tr>
  21. <tr>
  22. <td>
  23. <button type="submit">Send</button>
  24. </td>
  25. </table>
  26. </form>


  27. <div id="form-response"></div>


  28. <script>
  29. $(function () {
  30. var form = $("#ajax-contact");
  31. form[0].reset(); 
  32. form.submit(function (event) {
  33. event.preventDefault();
  34. var data = {
  35. "name": $("#contact-name").val(),
  36. "email": $("#contact-email").val(),
  37. "message": $("#contact-message").val()
  38. };
  39. $.ajax({
  40. url: "../contact_form_handle.php", 
  41. data: JSON.stringify(data),
  42. contentType: "application/json; charset=utf-8",
  43. dataType: "text",
  44. type: "POST"})
  45. .done(function (response) {
  46. $("#form-response").text(response);
  47. form[0].reset(); 
  48. })
  49. .fail(function (data) {
  50. if (data.responseText.length) {
  51. $("#form-response").text(data.responseText);
  52. } else {
  53. $("#form-response").text("An error has occurred and your message could not be sent.");
  54. }
  55. })
  56. });
  57. });
  58. </script>


  59. <?php

  60. $data = json_decode(file_get_contents("php://input"));
  61. $name = trim($data->name);
  62. $name = str_replace(array("\r", "\n"), array(" ", " "), $name);
  63. $email = filter_var(trim($data->email), FILTER_SANITIZE_EMAIL);
  64. $message = trim($data->message);
  65. if (empty($name) || empty($message) || !filter_var($email, FILTER_VALIDATE_EMAIL)) {
  66. echo "One or more invalid entries. Please try again.";
  67. exit;
  68. }

  69. $to = "support@...com";
  70. $from = "From: contact-form@...com". "\r\n";
  71. $email = $_POST['email'];
  72. $name = $_POST['name'];
  73. $message = $_POST['message'];

  74. $message = "name: {$_POST['name']}\r\nemail: {$_POST['email']}\r\n\r\n{$_POST['message']}";

  75. if (mail($to, "Customer Inquiry", $message, $from)) {

  76. echo "Thank You. Your message has been sent.";
  77. } else {
  78. echo "An error has occurred and your message could not be sent.";
  79. }
  80. ?>


Any help will be appreciated.