title: Sending mail from php script in a scheduled task using sendmail
body: <p>I am sending mail using sendmail package in my application
  the mail sending function is simple :</p>
  <p><code>mail($to,$subject,$mailmessage);</code></p>
  <p>My application is installed on Windows Server 2008. I have scheduled a task using task scheduler to run the script every 5 minutes</p>
  <p>All the script runs but mail is not working the error I get on the cmd display is :</p>
  <blockquote>
  <p>PHP Warning:  mail(): Failed to connect to mailserver at &quot;localhost&quot; port 25, ve
  rify your &quot;SMTP&quot; and &quot;smtp_port&quot; setting in php.ini or use ini_set() in C:\wamp<br />
  www\RCold\mailingcron.php on line 3
  PHP Stack trace:
  PHP   1. {main}() C:\wamp\www\RCold\mailingcron.php:0
  PHP   2. mail() C:\wamp\www\RCold\mailingcron.php:3</p>
  </blockquote>
  <blockquote>
  <p>Warning: mail(): Failed to connect to mailserver at &quot;localhost&quot; port 25, verify
  your &quot;SMTP&quot; and &quot;smtp_port&quot; setting in php.ini or use ini_set() in C:\wamp\www\R
  Cold\mailingcron.php on line 3</p>
  </blockquote>
  <blockquote>
  <p>Call Stack:
  0.0008     227816   1. {main}() C:\wamp\www\RCold\mailingcron.php:0
  0.0008     228800   2. mail() C:\wamp\www\RCold\mailingcron.php:3</p>
  </blockquote>
  <p>If I run the same script on a browser, the mail function works properly.</p>
  <p>How can I run the mail function from command line</p>