title: failed to connect to mail server in PHP
body: <p>I have written a small piece of PHP code for sending mail:</p>
  
  <pre><code>   &lt;?php
      //define the receiver of the email
      $to = 'rohaanthakare@gmail.com';
      //define the subject of the email
      $subject = 'Hishob email';
      //define the message to be sent. Each line should be separated with \n
      $message = "Hello World!\n\nThis is my first mail.";
      //define the headers we want passed. Note that they are separated with \r\n
      $headers = "From: webmaster@example.com\r\nReply-To: webmaster@example.com";
      //send the email
      $mail_sent = mail( $to, $subject, $message, $headers );
      //if the message is sent successfully print "Mail sent". Otherwise print "Mail failed" 
      echo $mail_sent ? "Mail sent" : "Mail failed";
      ?&gt;
  </code></pre>
  
  <p>after executing it I got following warning:</p>
  
  <blockquote>
    <p>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:\wamp\www\NewHishob\PhpFiles\send_mail.php on line 11<br>
    Mail failed</p>
  </blockquote>
  
  <p>I am using a WAMP server and there are two files, INI-DIST and other is INI-RECOMENDED. Which one is important?</p>
  
  <p>I had also gone through php.ini-dist file and for SMTP it contains the following:</p>
  
  <pre><code>[mail function]
  ; For Win32 only.
  SMTP = localhost
  smtp_port = 25
  
  ; For Win32 only.
  ;sendmail_from = me@example.com
  
  ; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
  ;sendmail_path =
  </code></pre>
  
  <p>Please suggest what I should do? Thanks to all in advance.</p>