想請教各位大大我的mail 問題
In XAMPP windows server 2008
不管是調php設定配mail()
或是用phpmailer 都不行
開始覺得是不是系統網路設定問題
telnet smtp.aa.bb 25 去 也會有回應
是防火牆要特別開哪個port 嗎 我有試過進出全開 也沒變 orz
幫我解決 願意做個遊戲網站回報
以下是我的code
<?php
require("./phpmailer/class.phpmailer.php");
$mailer = new PHPMailer();
$mailer->IsSMTP();
$mailer->Host = 'smtp.haha.tw';
$mailer->Port = 25;
$mailer->SMTPAuth = TRUE;
$mailer->Username = 'id@haha.tw';
$mailer->Password = 'yoyo';
$mailer->From = 'GGGGGG';
$mailer->FromName = 'fake';
$mailer->Body = 'hahaha';
$mailer->Subject = 'hehehe';
$mailer->AddAddress('ggggg@yahoo.com.tw');
if(!$mailer->Send()){
echo "Message was not sent<br/ >";
echo "Mailer Error: " . $mailer->ErrorInfo;
}
else{ echo "Message has been sent";}
?>
錯誤是:
SMTP Error: Could not connect to SMTP host. Message was not sent
Mailer Error: SMTP Error: Could not connect to SMTP host.
先謝謝大大回答
作者: da9nini9 (ni) 2014-05-14 11:23:00
^er 錯字嗎?
作者: dasu88 2014-05-14 13:56:00
$mail->Port = '25'; //改這樣呢?打錯了:$mailer->Port='25';
作者:
gname ((′口‵)↗︴<><...<><)
2014-05-14 14:32:00你是用哪一家的mail? 有沒有要 ssl
謝謝各位大大幫忙!!! 剛把address換成實體ip 就可以了但換來的新錯誤是SMTP Error: Could not authenticateMailer Error: SMTP Error: Could not authenticate.
作者:
hangchu (無瑕心靈的永恆燦爛陽光)
2014-05-14 23:03:00$mailer->Username 的值應該只有@前面的部份,就是帳號而已