title: PHP MAILER, HOW TO INSERT HTML TABLE
body: <p>I have PHP mailer script and I am trying to add HTML table into it but when I do the script stops working.</p>
  
  <p>Here's the PHP mailer script</p>
  
  <pre><code>&lt;?php
  // Insert your email/web addresses and correct paths
  $mailto = 'adil@*******.co.uk' ;
  $from = "web@city.com" ;
  $subject = "Query from ******* 2012";
  $headers = "From: ******* Website";
  $formurl = "http://*******.co.uk/citycoaches3/formmail.php" ;
  $errorurl = "http://*******.co.uk/citycoaches3/error.php" ;
  $thankyouurl = "http://*******.co.uk/citycoaches3/thankyou.php" ;
  
  // Place Your Form info here...
  $pickuppoint = ($_POST['pickuppoint']);
  $destination = ($_POST['destination']);
  
  // Check If Empty
  
  // Add more Validation/Cleaning here...
  
  // Place your Corresponding info here...
  $message =
  
      "Pick Point: $pickuppoint\n\n" .
      "Destination: $destination\n\n" . 
      "noppl: $noppl\n\n" 
  ;
  
  // Leave Alone
  mail($mailto, $from, $message);
  header( "Location: $thankyouurl" );
  exit ;
  
  ?&gt;
  </code></pre>
  
  <p>Any help on this will be appreciated.</p>
  
  <p>Heres what i tried</p>
  
  <pre><code>&lt;?php
  
  $fromAddr = 'adil@********.co.uk'; // the address to show in From field.
  $recipientAddr = 'quotes@********.co.uk';
  $subjectStr = '[Quick] Query From ********';
  $date = date ("l, F jS, Y"); 
  $time = date ("h:i A"); 
  $forward = 1;
  $formurl = "http://www.********.co.uk/formmail.php" ;
  $errorurl = "http://www.********.co.uk/error.php" ;
  $thankyouurl = "http://www.********.co.uk/thankyou.php" ;
  header("location:thankyou.php");
  
  $mailBodyText = &lt;&lt;&lt;HHHHHHHHHHHHHH
  &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html;charset=utf-8"&gt;
  &lt;title&gt;Thank You&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;img src="http://********.co.uk/images/mailsig.png" /&gt; \n\n&lt;br /&gt;
  &lt;span style="color:#900; font-size:18px;"&gt;Below is the result submitted from &lt;strong&gt;[Quick Quote] ******** Website&lt;/strong&gt;. It was submitted on &lt;strong&gt;$date at $time&lt;/strong&gt;.\n\n&lt;/span&gt; 
  &lt;p&gt;&lt;table width="600" border="1" cellpadding="5px"&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;b&gt;Pickup Date:&lt;/b&gt; &lt;/td&gt;
      &lt;td&gt;{$_POST['date']}&lt;br&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;b&gt;Pickup Time:&lt;/b&gt; &lt;/td&gt;
      &lt;td&gt;{$_POST['PickupTime-Hours']}:{$_POST['PickupTime-Mins']}&lt;br&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;b&gt;Pickup Point:&lt;/b&gt; &lt;/td&gt;
      &lt;td&gt;{$_POST['PickUp-Point']}&lt;br&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;b&gt;Destination:&lt;/b&gt; &lt;/td&gt;
      &lt;td&gt;{$_POST['Destination']}&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;b&gt;No. Of People:&lt;/b&gt; &lt;/td&gt;
      &lt;td&gt;{$_POST['No-of-Persons']}&lt;br&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;b&gt;Journey Type:&lt;/b&gt; &lt;/td&gt;
      &lt;td&gt;{$_POST['JourneyType']}&lt;br&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;tr&gt;
      &lt;td&gt;&lt;b&gt;Return Date:&lt;/b&gt; &lt;/td&gt;
      &lt;td&gt;{$_POST['returnDate']}&lt;br&gt;&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr&gt;
      &lt;td&gt;&lt;b&gt;Return Time:&lt;/b&gt; &lt;/td&gt;
      &lt;td&gt;{$_POST['returnTime-Hours']}{$_POST['returnTime-Mins']}&lt;br&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;tr&gt;
      &lt;td&gt;&lt;b&gt;Vehicle Type:&lt;/b&gt; &lt;/td&gt;
      &lt;td&gt;{$_POST['type']}&lt;br&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;tr&gt;
      &lt;td&gt;&lt;b&gt;Full Name:&lt;/b&gt; &lt;/td&gt;
      &lt;td&gt;{$_POST['Full-Name']}&lt;br&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;tr&gt;
      &lt;td&gt;&lt;b&gt;Tel / Mobile:&lt;/b&gt; &lt;/td&gt;
      &lt;td&gt;{$_POST['Tel-Mobile']}&lt;br&gt;&lt;/td&gt;
    &lt;/tr&gt;
        &lt;tr&gt;
      &lt;td&gt;&lt;b&gt;Email:&lt;/b&gt; &lt;/td&gt;
      &lt;td&gt;{$_POST['Email']}&lt;br&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
  &lt;/table&gt;
  
  
  
  
  &lt;/p&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  HHHHHHHHHHHHHH;
  
  $headers= &lt;&lt;&lt;TTTTTTTTTTTT
  From: $fromAddr
  MIME-Version: 1.0
  Content-Type: text/html;
  TTTTTTTTTTTT;
  
  mail($mailto, $from, $message,
      "From: \"$name\" &lt;$email&gt;" . $headersep . "Reply-To: \"$name\" &lt;$email&gt;" . $headersep );
  header( "Location: $thankyouurl" );
  exit ;
  
  ?&gt;
  </code></pre>
  
  <p>Still doesn't work for some reason. </p>
  
  <p><strong>Heres the UPDATE:</strong></p>
  
  <p>After removing</p>
  
  <pre><code>"From: \"$name\" &lt;$email&gt;" . $headersep . "Reply-To: \"$name\" &lt;$email&gt;" .
  </code></pre>
  
  <p>I managed to receive the email, but it pasted the whole code which is in $message.</p>