title: Changing CGI-Mailer in PHP mail script
body: <p>I have a php script that sends an email from an HTML form. The issue is that the sender shows as <code>CGI-Mailer</code> in my inbox.</p>
  
  <p><a href="https://i.stack.imgur.com/uNmR4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uNmR4.png" alt="enter image description here"></a></p>
  
  <p>How can I set the sender address to be that of the sender and not <code>CGI-Mailer</code>?</p>
  
  <pre><code>&lt;?php session_start();
  if(isset($_POST['Submit'])) {
  $youremail = 'info@complexny.com';
  $fromsubject = $_POST['fname'];
  $subject = $_POST['fname'];
  $fname = $_POST['fname'];
  $url = $_POST['url'];
  $mail = $_POST['mail'];
  $phone = $_POST['phone'];
  $headers  = "From: $mail \n";
  $headers .= 'X-Mailer: PHP/' . phpversion();
  $headers .= "MIME-Version: 1.0\r\n";
  $headers .= "Content-Type: text/html; charset=iso-8859-1\n";
  $message = $_POST['message'];
      $to = $youremail;
      $subject = ''.$fromsubject. ' is interested in a project with you.';
      $body = '
       Client: '.$fname.'
       Phone Number: '.$phone.'
       URL: '.$url.'
       E-mail: '.$mail.'
  
       Message:
       '.$message.'
       ';
  echo "&lt;p style='text-align:center'&gt;Thank you for your feedback. We will be in contact shortly.&lt;br/&gt;Continue to &lt;a href='/'&gt;The Company/a&gt;&lt;/p&gt;";
                                  mail($to, $subject, $body);
   } else {
  echo "You must write a message. &lt;/br&gt; Please go to &lt;a href='/contact.php'&gt;Contact Page&lt;/a&gt;";
  }
  ?&gt;
  </code></pre>