我試圖通過smtp發送電子郵件,但不幸的是,它沒有被髮送。似乎沒有錯誤。我哪裏有錯誤?SMTP電子郵件不發送
require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP(); // send via SMTP
$mail->Host = "mail.site.org"; // SMTP servers
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "[email protected]"; // SMTP username
$mail->Password = "123456"; // SMTP password
$mail->From = "[email protected]"; // smtp kullanıcı adınız ile aynı olmalı
$mail->Fromname = "giden ismi";
$mail->AddAddress("[email protected]","Ornek Isim");
$mail->Subject = $_POST['baslik'];
$mail->Body = implode(" ",$_POST);
if(!$mail->Send())
{
echo "Mail couldnt send <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
echo "Mail sent";
那麼什麼是輸出?你看到'Mail couldnt send'消息或'Mail sent'消息嗎? – Jordan 2014-11-08 23:31:43
你有SMTP服務器嗎?日誌裏有什麼? – andrewsi 2014-11-08 23:54:55
是的,我有Smtp服務器。我在網上使用檢查腳本檢查它。問題是發送郵件後。我收到「消息發送」報告,但我沒有收到郵件。 – bodrumlife 2014-11-09 01:02:07