我使用PHPMailer通过SMTP在共享服务器上发送电子邮件(我的托管服务是Softsys)。电子邮件正在发送到同一服务器上的电子邮件地址(即@域是我的网络域)。但是,当我试图改变收件人@gmail(或任何外部地址),我收到以下错误日志:PHPMailer SMTP错误550
SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "550 <[email protected]> No such user here"
SMTP -> get_lines(): $data is "550 <[email protected]> No such user here"
SMTP -> FROM SERVER:550 <[email protected]> No such user here
SMTP -> ERROR: RCPT not accepted from server: 550 <[email protected]> No such user here
SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "250 OK"
SMTP -> get_lines(): $data is "250 OK"
SMTP -> FROM SERVER: 250 OK
Message could not be sent.
Mailer Error: SMTP Error: The following recipients failed: [email protected]
这是我的服务器或我的代码的问题吗?我应该只是联系我的服务器管理员?预先感谢您的任何帮助!
这里是我的代码
require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = "mail.mywebsite.com";
$mail->SMTPAuth = true;
$mail->Username = "myemail";
$mail->Password = "********";
$mail->From = "[email protected]";
$mail->FromName = "John Doe";
$mail->AddAddress("[email protected]");
$mail->IsHTML(true);
$mail->Subject = "Here is the subject";
$mail->Body = "This is the HTML message body <b>in bold!</b>";
$mail->AltBody = "This is the body in plain text for non-HTML mail clients";
if(!$mail->Send())
{
echo "Message could not be sent. <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
echo "Message has been sent";