JQuery Date Picker not emailing PHP Mail script

JQuery Date Picker not emailing PHP Mail script

Hi,

I wonder if anyone can help me. I am building a few forms and one of them requires a date, I am using the date picker however the dates are not being emailed. I am using PHP for the form and the mail script. Heres the code for my test form -
          
      Contact Form PHP
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5.   <title>jQuery UI Datepicker - Default functionality</title>
  6.   <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
  7.   <link rel="stylesheet" href="/resources/demos/style.css">
  8.   <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
  9.   <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
  10.   <script>
  11.   $( function() {
  12.     $( "#datepicker" ).datepicker();
  13.   } ); </script>  
  14. <style type="text/css">
  15. #FormDiv {
  16. width: 400px;
  17. height: auto;
  18. margin-left: auto;
  19. margin-right: auto;
  20. margin-top: 60px;
  21. background: #8D8D8D;
  22. text-align: left;
  23. padding-bottom: 6px;
  24. padding-top: 6px;
  25. padding-left: 6PX;
  26. padding-right: 6px;
  27. }
  28. #Message {
  29. width: 390px;
  30. height: 300px;
  31. }
  32. </style>

  33. </head>

  34. <body>

  35. <div id="FormDiv"><form action="mailscript.php" method="post" id="ContactForm"><table border="0">
  36.   <tbody>
  37.     <tr>
  38.       <td><label for="Subject">Subject:</label>
  39.         <input type="text" name="Subject" id="Subject"></td>
  40.     </tr>
  41.     <tr>
  42.       <td><label for="Email">*Email:</label>
  43.         <input type="email" name="Email" required="required" id="Email"></td>
  44.     </tr>
  45.     <tr>
  46.       <td><label for="textarea">*Message:</label>
  47.         <textarea name="Message" required="required" id="Message"></textarea></td>
  48.     </tr>
  49.     <tr>
  50.       <td><label for="datepicker">Date:</label> <input type="text" name="datepicker" id="datepicker"></p></td>
  51.     </tr>
  52.     <tr>
  53.       <td><input type="submit" name="submitButton" id="submitButton" value="Send Message"></td>
  54.     </tr>
  55.     <tr>
  56.       <td>&nbsp;</td>
  57.     </tr>
  58.   </tbody>
  59. </table>
  60. </form>
  61. </div>

  62. </body>
  63. </html>


       Mail Script PHP
  1. <?php

  2. $from=$_POST['Email'];
  3. $email="cameron.nicholson96@gmail.com";
  4. $subject=$_POST['Subject'];
  5. $message=$_POST['Message'];
  6. $date=$_POST['datepicker'];

  7. mail( $email, $subject, $message, $date, "From:".$from);

  8. Print "Your Message Has Been Sent";
*NOTE*: With this current mail script code, specifically $date in line 10, no emails are received at all.

Any advice would be greatly appreciated.

Thanks