Mail function problem in PHP
<p>I am having trouble sending emails with PHP. Can you see any problems in my code?</p>

<p>php.ini mail settings:</p>

<pre><code>[mail function]
SMTP = mail.ntserv.co.in
smtp_port = 26
</code></pre>

<p>Code:</p>

<pre><code>&lt;?php
$to = "vijay@gmail.com";
$subject = "Test mail";
$message = "hi, How r u";
$from = "vijay@ntserv.co.in";
$headers = "From: $from";
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?&gt;
</code></pre>

<p>Output:</p>

<blockquote>
  <p>Warning: mail() [function.mail]: SMTP server response: 551 This mail server requires authentication before sending mail from a locally hosted domain. Please reconfigure your mail client to authenticate before sending mail. in C:\xampp\htdocs\vijay\demo\msg.php on line 7 Mail Sent.</p>
</blockquote>
