我正在使用 PHPmailer 从网站向网站所有者发送电子邮件。它适用于某些地址(例如我的 Gmail 帐户),它曾经适用于所有者的地址,但他最近从 POP 更改为 IMAP,现在他没有收到来自该网站的电子邮件。他确实收到了来自其他来源的电子邮件。这是代码:
$mail = new PHPMailer(true);
try {
$mail->AddAddress($to, 'Example To');
$mail->SetFrom('example@example.com', 'Example');
$mail->AddReplyTo('example@example.com', 'Example');
$mail->Subject = $subject;
$mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically
$mail->MsgHTML($message);
$mail->Send();
//echo "Message Sent OK</p>\n";
} catch (phpmailerException $e) {
echo $e->errorMessage(); //Pretty error messages from PHPMailer
} catch (Exception $e) {
echo $e->getMessage(); //Boring error messages from anything else!
}
非常感谢任何建议。谢谢!G