title: I changed the SMTP and SMTP Port but it still says Failed to connect to mailserver at "localhost" port 25
body: <p>I am currently using <code>xampp 1.7.0</code> and my php version is <code>5.2.8</code></p>
  
  <p>I changed my <code>php.ini</code> file to:</p>
  
  <pre><code>[mail function]
  ; For Win32 only.
  SMTP = smtp.gmail.com
  smtp_port = 465
  </code></pre>
  
  <p>and my send_email.php file looks like:</p>
  
  <pre><code>$to = "myemail@gmail.com";
  $subject = "Test mail";
  $message = "Hello! This is a test message.";
  $from = "someonelse@gmail.com";
  $headers = "From:" . $from;
  mail($to,$subject,$message,$headers);
  </code></pre>
  
  <p>But, it shows the following message:</p>
  
  <p><code>
  Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\xampp\htdocs\NFL\send_email.php on line 15</code></p>
  
  <p>Line number 15 is:</p>
  
  <p><code>mail($to,$subject,$message,$headers);</code></p>
  
  <p>How can I resolve this issue?</p>
  
  <p>Note: I also added a 5th parameter to the mail call to force the system to use the From Email Address, but it didn't worked!</p>