title: Send Email with PHP/AJAX From HTML Form
body: <p>I want to send the information the user has filled out from an HTML form to my email address. From my understanding, this cannot be done by using only client-side coding due to the nature of how emails work, and suggested to use PHP (combined with AJAX) to handle the server-side code. I followed the guide <a href="https://stackoverflow.com/questions/5051772/jquery-php-mail-send-the-easy-way">here</a> but I am not receiving any emails at my email address. I am testing locally on my machine (using XAMPP) before I deploy my code on my client's web space (goDaddy). I want to note that I have never used PHP before.</p>
  
  <p>Javascript:</p>
  
  <pre><code>var data = "This is my email";
  $.ajax({
      type: "POST",
      url: "email.php",
      data: data,
      dataType: "text"
  });
  </code></pre>
  
  <p>PHP (email.php):</p>
  
  <pre><code>&lt;?php
  $to = "myself@hotmail.com";
  $subject = "This is my email";
  $message = $_REQUEST;
  $send = mail($to, $subject, $message);
  if(!$send){    
      die();  
  }
  ?&gt;
  </code></pre>