我使用 phpMailer,但我有一个问题:当收件人是 Gmail 或 Yahoo 时,我的电子邮件最终会进入垃圾邮件文件夹。这怎么可能?代码是这样的:
$mail->AddCustomHeader('Reply-to:info@myemal.com');
$mail->From="info@myemal.com";
$mail->FromName="MY NAME";
$mail->IsSendmail();
$mail->AddReplyTo("info@myemail.com");
$mail->From = 'info@myemail.com';
$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