title: How to configure PHP to send e-mail?
body: <p>I need to send mail to the users of my website using php script. I have tried using mail function in php.<br>
  My code is as follows:</p>
  
  <pre><code>  $to = "myweb@gmail.com";
    $subject = "Test mail";
    $message = "My message";
    $from = "webp@gmail.com";
    $headers = "From:" . $from;
    mail($to,$subject,$message,$headers);
  </code></pre>
  
  <p>When I try running the program this is what I get:</p>
  
  <pre><code> Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set().
  </code></pre>
  
  <p>Please tell me what address to include in the $from variable. Do I need a smtp server for  this? How do I send mails using a localhost? Please tell me what exactly to edit in the php.ini file</p>
  
  <p>I am new to all this.. Please help me..</p>