我已经在互联网上尝试过每一种方式,但不是那些解决了我的问题。我正在使用WAMP 2.2无法连接到“本地主机”端口25的邮件服务器,请验证您的“SMTP”
我使用表单来要求nyu学生电子邮件,当学生提交表单时,它会发送给另一个nyu.edu电子邮件并收到确认。
原代码:
// 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: [email protected]\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 = "[email protected]";
$email_subject = "New Teaching Award Nomination";
$email_body =
"A new teaching award nomination has been submitted by ".$NAME." nominating ".$NOMINEE.".";
$email_headers = "From: [email protected]\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
错误味精无法连接在 “localhost” 的端口25的邮件服务器,验证您的 “SMTP”
所以后来我绑把
ini_set("SMTP","nyu.smtp.edu");
ini_set("smtp_port","587");
但它显示:未能连接到ma ilserver在“nyu.smtp.edu”端口587,验证你的“SMTP”
我不知道该怎么做!请帮忙
这可能是因为您没有提供任何身份验证凭据。 – thatidiotguy
从问题中编辑出您的个人信息;请不要将它添加回来。 – brandonscript
此外,如果您最终需要使用身份验证(修复SMTP端口后),您需要使用类似[PEAR](http://stackoverflow.com/questions/12166468/sending-html-message-through -pear-while-using-smtp-authentication-returns-an-err) – brandonscript