title: Getting error while sending email in html using php
body: <p>I want to send email using php in html. For the purpose I wrote the following code:</p>
  
  <pre><code>&lt;?php
      if($_SERVER['REQUEST_METHOD'] == 'POST')
      {
          if ( mail ('ahmsjahan@gmail.com','New Website message' ,$_POST['message']))
               $status = "Thank you for your message";    
      }
      if ( isset($status))
          echo $status;
   ?&gt;
    &lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;
              I am don
          &lt;/title&gt;
      &lt;/head&gt;
  
      &lt;body&gt;
          &lt;h1&gt;
              Contact Form
          &lt;/h1&gt;
  
          &lt;form action = "" method = "post"&gt;
              &lt;ul&gt;
                  &lt;li&gt;
                      &lt;label for = "name"&gt; Name: &lt;/label&gt;
                      &lt;input type = "text" id="name"name = "name"&gt;
                  &lt;/li&gt;
  
                  &lt;li&gt;
                      &lt;label for = "email" &gt; Email: &lt;/label&gt;
                      &lt;input type="email" id="email" name = "email"&gt;
                  &lt;/li&gt;
                  &lt;li&gt;
                      &lt;label for = "messsage" &gt; Message: &lt;/label&gt;&lt;br&gt;
                      &lt;textarea name = "message" id="message"&gt;&lt;/textarea&gt;
                  &lt;/li&gt;
                  &lt;li&gt;
                      &lt;input type = "submit" value= "submit"&gt;
                  &lt;/li&gt;
              &lt;/ul&gt;
          &lt;/form&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I am getting error like this:</p>
  
  <p>While sending ( ! ) 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\form.php on line 4</p>
  
  <p>Should I change something at line 4 in php.ini file?</p>