title: "From" in php mail $headers not passing
body: <p>I have a mail script that was working fine and I can't figure out what changed that's not causing the "from" to pass. </p>
  
  <p>I have this code in a mail function </p>
  
  <pre><code>$to = ($_POST['email']);
  $subject = 'Welcome to the Team!';
  $url = 'mydomain.com'; 
  $headers = "From: info@mydomain.com\r\n";
  $headers = "BCC: me@mydomain.com\r\n";
  $headers = "MIME-Version: 1.0\r\n";
  $headers = "Content-Type: text/html; charset=ISO-8859-1\r\n";
  ...
  mail($to, $subject, $message, $headers);
  </code></pre>
  
  <p>The problem is, when the email comes through, the "from" looks like this: </p>
  
  <blockquote>
    <p>From: (mydomain)@(someletters&amp;numbers).shr.phx3.(myhost).net</p>
  </blockquote>
  
  <p>instead of ...</p>
  
  <blockquote>
    <p>From: info@mydomain.com</p>
  </blockquote>
  
  <p>What's up? </p>
  
  <hr>
  
  <p>UPDATE WITH FULL CODE</p>
  
  <pre><code>...
  if(count($errors) == 0) {
  $to = 'me@mydomain.com';
  $subject = 'Subject';
  $headers = "From: me@ mydomain.com\r\n";
  $headers = "BCC: someonelese@ mydomain.com\r\n";
  $headers = "MIME-Version: 1.0\r\n";
  $headers = "Content-Type: text/html; charset=ISO-8859-1\r\n";
  $message = "&lt;html&gt;&lt;body&gt;…Email Message 1…&lt;/body&gt;&lt;/html&gt;";
  mail($to, $subject, $message, $headers);
  }
  if(count($errors) == 0) {
  $to = ($_POST['email']);
  $subject = 'Subject';
  $url = 'mydomain.caom'; 
  $headers = "From: me@ mydomain.com\r\n";
  $headers = "BCC: someonelese@ mydomain.com\r\n";
  $headers = "MIME-Version: 1.0\r\n";
  $headers = "Content-Type: text/html; charset=ISO-8859-1\r\n";
  $message = "&lt;html&gt;&lt;body&gt;…Email Message 2…&lt;/body&gt;&lt;/html&gt;";
  mail($to, $subject, $message, $headers);
  echo '&lt;META HTTP-EQUIV=Refresh CONTENT="1; URL='.$url.'"&gt;';
  }
  </code></pre>