我使用phpMailer,但我遇到了一個問題:當收件人是Gmail或雅虎時,我的電子郵件最終位於垃圾郵件文件夾中。這怎麼可能? 的代碼是這樣的:phpMailer Gmail垃圾郵件
$mail->AddCustomHeader('Reply-to:[email protected]');
$mail->From="[email protected]";
$mail->FromName="MY NAME";
$mail->IsSendmail();
$mail->AddReplyTo("[email protected]");
$mail->From = '[email protected]';
$mail->FromName = 'My name';
$mail->AddAddress($to, $toName);
$mail->Subject = $subject;
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!";
$mail->WordWrap = 80; // set word wrap
$body->'Hello';
$mail->MsgHTML($body);
$mail->IsHTML(true); // send as HTML