title: how to send email from Apache server by PHP script
body: <p>I have installed Apache and PHP on my Windows 7 PC. I learning the PHP now. Following is my PHP script to send email.</p>
  
  <pre><code>&lt;?php
      if(isset($_REQUEST['email']))
      {
          $email = $_REQUEST['email'];
          $subject = $_REQUEST['subject'];
          $message = $_REQUEST['message'];
          mail("padhy.surya@gmail.com","$subject","$message","From:","$email");
          echo "Thank you for using the email !!!";
      }
      else
      {
          echo "Mail is not set properly. Please fill the form properly";
      }
  ?&gt;
  </code></pre>
  
  <p>I am using a html form to get the required parameters for sending email. Following is the error I am getting while I send the email.</p>
  
  <blockquote>
    <p>Warning: mail() [function.mail]: Failed to connect to mailserver at
    "localhost" port 25, verify your "SMTP" and "smtp_port" setting in
    php.ini or use ini_set() in
    C:\WebLearn\Apache-2.2\htdocs\SimpleWebsite\contact.php on line 7</p>
  </blockquote>
  
  <p>Do I need to set anything to set in php.ini file or in httpd.conf? If yes how to configure it? Do I need an additional SMTP server on my PC to send email? Please suggest the necessary steps to send an email from my local PC.</p>