title: How can "reply-to" be added to the email we get from our website PHP form?
body: <p>More stringent DMARC policy means we are not getting emails from customers who use our online form if they enter a yahoo or AOL email address.</p>
  
  <p>I think this is because the PHP form generates an email that is sent from our website server but that has the customers own email address as 'from'. When this 'from' email is a yahoo email it triggers our receiving email account to block it. (We use gmail to read and reply to emails.)</p>
  
  <p>Therefore I am trying to work out how to modify the PHP form to put the customers email address as 'reply-to' and our own server email address as 'from' in the email that the PHP form on our server sends us. I want to be able to click 'reply' in gmail and be able to email the customer straight back. </p>
  
  <p>It would also be nice to have the customers name in the subject or the gmail from field to make the emails we receive from the form more readable, but this is of far less concern.</p>
  
  <p>Here is the content of the php file as it currently is.</p>
  
  <pre><code>&lt;?php
  $to         ="info@futonz.co.nz";
  $name       = ($_POST['name']);
  $email      = ($_POST['email']);
  $phone      = ($_POST['phone']);
  $enquiry    = ($_POST['enquiry']);
  $where      = ($_POST['where']);
  $sub        = "Enquiry from the Futonz Website!";
  $headers .= "From: $name &lt;$email&gt;\n";  
  $headers .= "Content-Type: text/plain; charset=iso-8859-1\n";
  $mes       = "".$sub."
  
  Name: ".$name."
  Email: ".$email."
  Phone: ".$phone." 
  
  Message: ".$enquiry."
  
  I found Futonz by: ".$where."";
  
  if(empty($name) || empty($email)) {
      header("Location:required-fields.html");
  } 
  
  elseif(!ereg("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) {
      header("Location:invalid-email.html");
  }
  
  else {
      mail($to, $sub, $mes, $headers);
      header("Location:contact-thanks.html");
      exit();
  }
  ?&gt;
  </code></pre>
  
  <p>Reading other people's advice, I have tried replacing the first $headers with the following:</p>
  
  <pre><code>$headers = 'From: '.futonz@futonz.co.nz."\r\n" .
          'Reply-To: '.$email."\r\n";
  </code></pre>
  
  <p>This did not work. The browser just goes to a blank screen.</p>
  
  <p>I have also tried adding another $headers line below the first like this:</p>
  
  <pre><code>$headers .= "From: $name &lt;info@futonz.co.nz&gt;\n";
  $headers .= "Reply-to: $name &lt;$email&gt;\n";  
  </code></pre>
  
  <p>This does appear in gmail as having the customer's email as 'reply to'. However, when 'reply' is clicked on in Gmail it puts info@futonz.co.nz as the recipient instead!</p>
  
  <p>To reply to TheGreenKey's comment below, when using the code:</p>
  
  <pre><code>$headers .= "From: $name &lt;info@futonz.co.nz&gt;\n";
  $headers .= "Reply-to: $name &lt;$email&gt;\n";  
  </code></pre>
  
  <p>then the following results:</p>
  
  <pre><code>Delivered-To: info@futonz.co.nz
  Received: by 10.52.238.130 with SMTP id vk2csp258969vdc;
          Fri, 13 Feb 2015 18:18:11 -0800 (PST)
  X-Received: by 10.140.19.14 with SMTP id 14mr30541534qgg.37.1423880290937;
          Fri, 13 Feb 2015 18:18:10 -0800 (PST)
  Return-Path: &lt;futonz@futonz.co.nz&gt;
  Received: from zeke.hosts.net.nz (zeke.hosts.net.nz. [210.48.108.243])
          by mx.google.com with ESMTPS id q137si1269163qha.85.2015.02.13.18.18.09
          for &lt;info@futonz.co.nz&gt;
          (version=TLSv1 cipher=RC4-SHA bits=128/128);
          Fri, 13 Feb 2015 18:18:10 -0800 (PST)
  Received-SPF: none (google.com: futonz@futonz.co.nz does not designate permitted sender hosts) client-ip=210.48.108.243;
  Authentication-Results: mx.google.com;
         spf=none (google.com: futonz@futonz.co.nz does not designate permitted sender hosts) smtp.mail=futonz@futonz.co.nz
  Received: from futonz.co.nz (localhost.localdomain [127.0.0.1])
      by zeke.hosts.net.nz (8.13.8/8.13.8) with ESMTP id t1E2Hxjm006900
      for &lt;info@futonz.co.nz&gt;; Sat, 14 Feb 2015 15:17:59 +1300
  Received: (from futonz@localhost)
      by futonz.co.nz (8.13.8/8.13.8/Submit) id t1E2Hwf6006899;
      Sat, 14 Feb 2015 15:17:58 +1300
  Date: Sat, 14 Feb 2015 15:17:58 +1300
  Message-Id: &lt;201502140217.t1E2Hwf6006899@futonz.co.nz&gt;
  To: info@futonz.co.nz
  Subject: Enquiry from the Futonz Website!
  From: Robin test &lt;info@futonz.co.nz&gt;
  Reply-to: Robin test &lt;teahigh@gmail.com&gt;
  Content-Type: text/plain; charset=iso-8859-1
  
  
  Enquiry from the Futonz Website!
  
  Name: Robin test
  Email: teahigh@gmail.com
  Phone: 09 
  
  Message: 
  
  I found Futonz by: 
  </code></pre>
  
  <p>Please tell me how to modify the php form so that the customer's email address appears when 'reply' is clicked on in gmail.</p>