title: PHP Email validator (form) from brackets
body: <p>I need help with the first $headers line.
  I need the from to look like this:</p>
  
  <pre><code>name &lt;email&gt;
  </code></pre>
  
  <p>actually</p>
  
  <pre><code>$field_name &lt;$field_email&gt;
  </code></pre>
  
  <p>It should show from email in email client</p>
  
  <pre><code>Personname &lt;person@emailaddress.com
  </code></pre>
  
  <p>How can I achieve this?</p>
  
  <pre><code>&lt;?php
  $field_name = $_POST['cf_name'];
  $field_email = $_POST['cf_email'];
  $field_message = $_POST['cf_message'];
  $field_phone = $_POST['cf_phone'];
  
  $mail_to = 'from@email.com';
  $subject = 'Enquiry from Website, From: '.$field_name;
  
  $body_message = 'Enquiry submitted to business, via website contact form.';
  $body_message = 'From: '.$field_name."\n";
  $body_message .= 'E-mail: '.$field_email."\n";
  $body_message .= 'Telephone Number: '.$field_phone."\n";
  $body_message .= 'Message: '.$field_message;
  
  $headers = 'From: '$field_name' &lt;'$field_email'&gt;'"\n";
  $headers .= 'Reply-To: '.$field_email.;
  
  $mail_status = mail($mail_to, $subject, $body_message, $headers);
  include 'contactendd.php';
  
  if ($mail_status) { ?&gt;
  &lt;script language="javascript" type="text/javascript"&gt;
      window.location = 'thanks.html';
  &lt;/script&gt;
  &lt;?php
  }
  else { ?&gt;
      &lt;script language="javascript" type="text/javascript"&gt;
      window.location = 'thanksfailed.html';
      &lt;/script&gt;
  &lt;?php
  }
  ?&gt;
  </code></pre>
  
  <p>Thanks very much for your help</p>