title: unknown sender in sent emails by mail function php
body: <p>Hi I am using the the mail function in php to send emails but the emails in the inbox of the receiver show the name as "unknown sender" in gmail and going in spam in yahoo, here is the code for the function.</p>
  
  <pre><code>function send_email1($from, $fromaddress, $to, $sub, $mes)
  {
    $headers = "MIME-Version: 1.0\r\n";  
    $headers .= "Content-type: text/plain; charset=utf-8\r\n";  
    $headers .= "To: ".$to." &lt;".$to."&gt;\r\n";  
    $headers .= "From: ".$from." &lt;".$from."&gt;\r\n";  
    $headers .= "Reply-To: ".$from." &lt;".$from."&gt;\r\n";  
    $headers .= "Return-Path: ".$from." &lt;".$from."&gt;\r\n";  
  
     mail($to, $sub, $mes, $headers);   
     return mail($to, $sub, $mes, $headers); ;
  }
  </code></pre>