SMTP -> ERROR: Failed to connect to server: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (10060) The following From address failed:[email protected] : Called Mail() without being connected Mailer Error: The following From address failed: [email protected] : Called Mail() without being connectedPHPMailer錯誤
我無法發送電子郵件我收到上述錯誤。 這裏的代碼
<?php require_once("Project/function/PHPMailer/class.phpmailer.php");
$mail = new PHPMailer(); // create a new object
$mail->IsSMTP(); // enable SMTP
$mail->SMTPDebug = 1; // debugging: 1 = errors and messages, 2 = messages only
$mail->SMTPAuth = true; // authentication enabled
$mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for GMail
$mail->Host = "ssl://smtp.gmail.com";
$mail->Port = 465; // or 587
$mail->IsHTML(true);
$mail->Username = "[email protected]";
$mail->Password = "password";
$mail->SetFrom("[email protected]");
$mail->Subject = "Test";
$mail->MsgHTML("Hello World");
$mail->AddAddress("[email protected]");
if(!$mail->Send()){
echo "Mailer Error: " . $mail->ErrorInfo;
}
else{
echo "Message has been sent";
}
?>
我正在使用wamp ver 2.4。 wamp服務器處於offline狀態。打開的SSL擴展已啓用已檢查php.ini文件;已經從打開的ssl dll中刪除。
是否使用PEAR更好?
似乎您的郵件服務器拒絕連接,也許您嘗試連接的服務器上關閉了主題端口。 –
我的學院防火牆可能是從我的加密狗工作正常的原因對不起浪費你的時間應該從我的加密狗檢查它 – AAB
偉大。由於沒有標準的端口使用情況,它經常發生。如果不使用,這些是真實的。 –