title: php function mail() isn't working
body: <p>I used mail() function in php coding but I failed to send any mail. Before proceeding ahead I want to elaborate the context of using the mail() function.</p>
  
  <p>I didnt host my site so it is on localhost.
  I did set smtp, port sendmail_path etc.</p>
  
  <p>After searching a lot I it seems that I need to download a mail server.
  I downloaded a sendmail server that is free and configured it as the site suggested.
  However, all in vain moreover, someone told me that I can't use mail function until I host my site not only on localhost. Please guide me.</p>
  
  <pre><code>&lt;?php
     $from = "oooo@hotmail.com"; // sender
     $subject = " My cron is working";
     $message = "My first Cron  :)";
  
     // message lines should not exceed 70 characters (PHP rule), so wrap it
  
     $message = wordwrap($message, 70);
  
     // send mail
  
     ini_set("SMTP","localhost");
     ini_set("smtp_port","25");
     ini_set("sendmail_from","00000@gmail.com");
     ini_set("sendmail_path", "C:\wamp\bin\sendmail.exe -t");
  
     mail("jXXXXXX@gmail.com",$subject,$message,"From: $from\n");
  
     echo "Thank you for sending us feedback";
  
  ?&gt;
  </code></pre>
  
  <p>this my sendmail configuration file:</p>
  
  <pre><code>smtp_server=smtp.gmail.com
  smtp_port=587
  smtp_ssl=auto
  
  ;default_domain=domain.com
  auth_username=jxxxx@gmail.com
  auth_password=8888
  
  force_sender=j*****@gmail.com
  
  ( ! ) SCREAM: Error suppression ignored for
  ( ! ) 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:\wamp\www\test.php on line 20
  </code></pre>