title: problem with php mail 'From' header
body: <p>I'm building a website that sends and email to a user when he registers.</p>
  
  <p>My code (the gist of it):</p>
  
  <pre><code>&lt;?php
  $to = "helloworld@gmail.com";
  $subject = "Test mail";
  $message = "Hello! \nThis is a simple email message.";
  
  $headers = "From: munged@gmail.com";
  $headers .= "\r\nReply-To: munged@gmail.com";
  $headers .= "\r\nX-Mailer: PHP/".phpversion();
  
  mail($to,$subject,$message,$headers);
  
  echo "Mail Sent.";
  ?&gt; 
  </code></pre>
  
  <p>the problem is that when the mail is delivered, the from header remains <code>munged@box123.bluehost.com</code>, while reply-to gets changed to the specified value.</p>
  
  <p><code>box123.bluehost.com</code> is the hostname of the server on which the website is hosted.</p>
  
  <p>So what am I doing wrong? What can I do to get the "From" address the same as the reply-to address?</p>
  
  <p>Is it something I'm doing wrong, or is the web host playing foul?</p>