Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/4532486/failed-to-connect-to-mailserver-at-localhost-port-25">Failed to connect to mailserver at &ldquo;localhost&rdquo; port 25</a>  </p>
</blockquote>



<p>I used this one however</p>

<pre><code>$to = "somebody@example.com";
$subject = "My subject";
$txt = "Hello world!";
$headers = "From: webmaster@example.com" . "\r\n" .
"CC: somebodyelse@example.com";

mail($to,$subject,$txt,$headers);
</code></pre>

<p>I have this error which is Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()</p>
