这是我的代码:
$boundary = sha1('whatever');
$headers = 'MIME-Version: 1.0'."\r\n";
$headers .= 'From: "Domainname" [email protected] /cdn-cgi/l/email-protection'."\r\n";
$headers .= 'Reply-to: Domainname <[email protected] /cdn-cgi/l/email-protection>'."\r\n";
$headers .= 'X-Priority: 3'."\r\n";
$headers .= 'X-Mailer: Mail 1.0'."\r\n";
$headers .= 'Subject: '.$subject."\r\n";
$headers .= 'Content-Type: multipart/alternative; boundary="'.$boundary.'"'."\r\n\r\n";
$message = '--'.$boundary."\r\n";
$message .= 'Content-Type: text/plain; charset="utf-8"'."\r\n\r\n";
$message .= $text."\r\n";
$message .= '--'.$boundary."\r\n";
$message .= 'Content-Type: text/html; charset="utf-8"'."\r\n\r\n";
$message .= $html."\r\n";
$message .= '--'.$boundary.'--';
mail($email, $subject, $message, $headers);
它适用于 Gmail、Yahoo、GMX...但不适用于 Hotmail/Live/MSN。
因为它适用于 Gmail,所以我可以假设它与我的服务器无关,对吗?
我也尝试过:
mail('u[email protected] /cdn-cgi/l/email-protection', 'This is a subject', 'This is the body');
同样的问题。它甚至没有发送到我的垃圾文件夹。
旧答案:
Hotmail 会阻止没有 SPF 记录的域。你可以做一个here https://www.unlocktheinbox.com/senderid-wizard/
edit:
截至 2015 年 6 月,共同要求为:
1) DKIM 在 Exim 中启用 DKIM 现在是一个非常重要的工具,可以减少您的电子邮件被标记为垃圾邮件的机会。强烈建议为您的域启用 DKIM。
2) SPF记录用-all代替~all
3) DMARC 记录可帮助远程服务器决定如何处理失败的 DKIM/SPF 消息。
4) 通常的事情,a) 例如发送 IP 上的反向 IP 查找,b) 最好指向相同 IP 的 rDNS 值的正向查找,c) 主机名上的 MX 记录。
Example:
"v=spf1 a mx ip4:1.2.3.4 -all"
其中 1.2.3.4 是您服务器的 IP。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)