我的 phpmailer 有问题,它返回 true,但邮件没有送达。这是我的代码。
require_once('class.phpmailer.php');
$mail = new PHPMailer(); // create a new object
$mail->IsSMTP(); // enable SMTP
$mail->SMTPDebug = 2; // debugging: 1 = errors and messages, 2 = messages only
$mail->SMTPAuth = true; // authentication enabled
$mail->Host = "smtp.postmarkapp.com";
$mail->Port = 25; // or 587
$mail->Username = "XXXXXXXXX";
$mail->Password = "XXXXXXXXXXXX";
$mail->SetFrom("sudeep777@hotmail.com");
$mail->Subject = "Test";
$body = "its a test message";
$mail->AddAddress("sudeep777@gmail.com");
$mail->MsgHTML($body);
if (!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message has been sent";
}
It simply returns:
SMTP -> FROM SERVER:220 smtp.postmarkapp.com ESMTP aws-dub-smtp1
SMTP -> FROM SERVER: 250-smtp.postmarkapp.com 250-PIPELINING 250-SIZE 20480000 250-VRFY 250-ETRN 250-STARTTLS 250-AUTH PLAIN LOGIN CRAM-MD5 DIGEST-MD5 250-AUTH=PLAIN LOGIN CRAM-MD5 DIGEST-MD5 250-ENHANCEDSTATUSCODES 250-8BITMIME 250 DSN
SMTP -> FROM SERVER:250 2.1.0 Ok
SMTP -> FROM SERVER:250 2.1.5 Ok
SMTP -> FROM SERVER:354 End data with .
SMTP -> FROM SERVER:250 2.0.0 Ok: queued as 0AE8D259B4
信息已发送
为什么没有发送电子邮件?