I have tried every single way on the internet but non of those solve my problem. I'm using WAMP 2.2
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.
original 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("<p>Message successfully sent!</p>");
} else {
echo("<p>Message delivery failed...</p>");
}
//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("<p>Message successfully sent!</p>");
} else {
echo("<p>Message delivery failed...</p>");
}
//end notification email
the error msg is Failed to connect to mailserver at "localhost" port 25, verify your "SMTP"
so then I tied to put
ini_set("SMTP","nyu.smtp.edu");
ini_set("smtp_port","587");
but it shows: Failed to connect to mailserver at "nyu.smtp.edu" port 587, verify your "SMTP"
I don't know what to do!! please help