title: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP"
body: <p>I have tried every single way on the internet but non of those solve my problem. I'm using WAMP 2.2</p>
  
  <p>I'm using a form to require nyu student email and when the student submit the form it will send  to another nyu.edu email and receive a confirmation. </p>
  
  <p><strong>original code:</strong></p>
  
  <pre><code>// send the notification email
  $mailto =  $EMAIL;//requied from the form
  $subject = "Thank you for your nomination!";
  $body = 
  "Dear ".$NAME.",
  
  This confirms that we have received your nomination of ".$NOMINEE." for a teaching award. Thank you for your submission.
  
  NYU Teaching Awards Team";
  $headers = "From: somemail@example.com\n\n";
  if (mail($mailto, $subject, $body, $headers)) {
      echo("&lt;p&gt;Message successfully sent!&lt;/p&gt;");
  } else {
      echo("&lt;p&gt;Message delivery failed...&lt;/p&gt;");
  }
  //end notification email
  
  
  // send the notification email
  $mail_to =  "somemail@example.com";
  $email_subject = "New Teaching Award Nomination";
  $email_body = 
  "A new teaching award nomination has been submitted by ".$NAME." nominating ".$NOMINEE.".";
  $email_headers = "From: somemail@example.com\n\n";
  if (mail($mail_to, $email_subject, $email_body, $email_headers)) {
      echo("&lt;p&gt;Message successfully sent!&lt;/p&gt;");
  } else {
      echo("&lt;p&gt;Message delivery failed...&lt;/p&gt;");
  }
  //end notification email
  </code></pre>
  
  <p>the error msg is <strong>Failed to connect to mailserver at "localhost" port 25, verify your "SMTP"</strong></p>
  
  <p>so then I tied to put  </p>
  
  <pre><code>ini_set("SMTP","nyu.smtp.edu");
  ini_set("smtp_port","587");
  </code></pre>
  
  <p>but it shows:  <strong>Failed to connect to mailserver at "nyu.smtp.edu" port 587, verify your "SMTP"</strong> </p>
  
  <p>I don't know what to do!! please help</p>