0
<?php
require_once "vendor/autoload.php";
$mail = new PHPMailer;
$mail->SMTPDebug = 0;
$mail->isSMTP();
$mail->Host = "localhost";
$mail->SMTPAuth = false;
$mail->Username = "[email protected]";
$mail->Password = "xxxxxxx";
$mail->SMTPSecure = "tls";
$mail->Port = 25;
$mail->From = "[email protected]"
$mail->FromName = "xxx";
$mail->addAddress("[email protected]", "example");
$mail->isHTML(true);
$mail->Subject = "Test";
$mail->Body = "<i>Helo</i>";
$mail->AltBody = "This is the plain text version of the email content";
if(!$mail->send())
{
echo "Mailer Error: " . $mail->ErrorInfo;
}
else
{
echo "Message has been sent successfully";
}
?>
梅勒錯誤:問題,它提供了錯誤代碼SMTP:550
此行是正確的:$ MAIL-> SMTPAUTH = FALSE;?不應該是真的嗎? –
if $ mail - > SMTPAuth = true;同樣,它也會引發同樣的錯誤。 –
你可以嘗試設置'SMTPDebug = 2',這樣你就可以看到實際發生了什麼。 – Synchro