title: PHP : send mail in localhost
body: <p>I would like to send email through php code hosted locally.</p>
  
  <pre><code>&lt;?php 
  $email  = "myemail@local.com"; 
  $titre   = "My subject"; 
  $message = "Text message !"; 
  mail($email, $titre, $message); 
  ?&gt;
  </code></pre>
  
  <p>When I run this code, I get the following error : </p>
  
  <pre><code>Warning: mail() [&lt;a href='function.mail'&gt;function.mail&lt;/a&gt;]: Failed to connect to mailserver at &amp;quot;localhost&amp;quot; port 25, verify your &amp;quot;SMTP&amp;quot; and &amp;quot;smtp_port&amp;quot; setting in php.ini or use ini_set() in C:\...
  </code></pre>
  
  <p>I went into the <code>php.ini</code> file and it seems to be already well configured. </p>
  
  <pre><code>[mail function]
  ; For Win32 only.
  ; http://php.net/smtp
  SMTP = localhost
  ; http://php.net/smtp-port
  smtp_port = 25
  </code></pre>
  
  <p>How can I fix this ? </p>
  
  <p>Thank you</p>