title: PHP email script with custom mail body
body: <p>I'm using a PHP email script for a contact form. There are six fields for the form:</p>
  
  <ul>
  <li>Name</li>
  <li>Email</li>
  <li>Phone number</li>
  <li>Booking Date</li>
  <li>Booking Time</li>
  <li>Comments</li>
  </ul>
  
  <p>There's also a hidden honeypot field for robotest. The PHP script is as follows:</p>
  
  <pre><code> &lt;?php 
  
  $robotest = $_POST['robotest']; //just testin' for robots
  
  $recipient = "info@mydomain.com"; //recipient 
  $email = ($_POST['email']); //senders e-mail adress 
  
  if((filter_var($email, FILTER_VALIDATE_EMAIL)) &amp;&amp; ($robotest == "")) { 
  
  $Name = ($_POST['name']); //senders name 
  
  $mail_body = !!!----&gt; WHAT DO I PUT HERE &lt;----!!!! 
  
  $subject = "Porter Inquiry"; //subject 
  $header = "From: ". $Name . " &lt;" . $email . "&gt;\r\n"; //optional headerfields 
  
  mail($recipient, $subject, $mail_body, $header); //mail command :) 
  
  } else {
    print "You've entered an invalid email address!";
  }
  ?&gt;
  </code></pre>
  
  <p>You'll notice above, where I put <code>!!!----&gt; WHAT DO I PUT HERE &lt;----!!!</code>, I'm unsure how to get multiple fields into the mail body. I'd like to include something like:</p>
  
  <pre><code>"Hello,
  
  You have received a new booking with the following details:
  
  Booking Time: ($_POST['time']) Booking Date:  ($_POST['date'])
  
  
  
  Additional customer comments: ($_POST['comments']);
  
  Please respond to the customer within 30 minutes on the following
  phone number: ($_POST['phone'])
  
  Warm regards,
  
  Robot."
  </code></pre>
  
  <p>I can't find any info on how to successfully achieve this, would greatly appreciate some guidance.</p>