你好我如何配置我的PHP郵件程序使它能夠使用這些設置? 如何根據虛擬主機的郵件賬戶配置SMTP設置
我試圖修復的用戶名和密碼,但我仍然得到這個錯誤 PHPMailer的錯誤:下面的發件人地址失敗:[email protected]:[郵件(),而無需連接
<?php
require 'class.phpmailer.php';
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Mailer = 'smtp';
$mail->SMTPAuth = true;
$mail->Host = 'gowebph.gowebph.com'; // "ssl://smtp.gmail.com" didn't worked
$mail->Port = 465;
$mail->SMTPSecure = 'tls';
// or try these settings (worked on XAMPP and WAMP):
// $mail->Port = 465;
// $mail->SMTPSecure = 'ssl';
$mail->Username = "[email protected]";
$mail->Password = "XXXXXXXXXXXXXX";
$mail->IsHTML(true); // if you are going to send HTML formatted emails
$mail->SingleTo = true; // if you want to send a same email to multiple users. multiple emails will be sent one-by-one.
$mail->From = "[email protected]";
$mail->FromName = "Your Name";
$mail->addAddress("[email protected]","User 1");
$mail->addAddress("[email protected]","User 2");
$mail->Subject = "Testing PHPMailer with localhost";
$mail->Body = "Hi,<br /><br />This system is working perfectly.";
if(!$mail->Send())
echo "Message was not sent <br />PHPMailer Error: " . $mail->ErrorInfo;
else
echo "Message has been sent";
?>
嘗試添加$ mail-> SMTPDebug = 4;啓用詳細的調試輸出。這可能會給你一個提示。 – 2014-11-04 08:17:25