我对此感到非常恼火,因为无论垃圾邮件过滤器看起来如何,仍然将我的网站自动回复器称为垃圾邮件。我已经正确设置了所有标题,这就是我到目前为止所拥有的!
$headers = "From: Name<<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="4e202f232b0e392b2c3d273a2b602d2123" rel="noreferrer noopener nofollow">[email protected]</a>>\r\n"
."Return-Path: Name<<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="bbd5dad6defbccded9c8d2cfde95d8d4d6" rel="noreferrer noopener nofollow">[email protected]</a>>\r\n"
."Reply-To: Name<<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1c727d71795c6b797e6f756879327f7371" rel="noreferrer noopener nofollow">[email protected]</a>>\r\n"
."Message-ID: <". time() .rand(1,1000). "@".$_SERVER['SERVER_NAME'].">\r\n"
."X-Mailer: PHP v".phpversion()."\r\n"
."MIME-Version: 1.0\r\n"
."Content-Type: text/plain; charset=iso-8859-1\r\n";
@mail($_POST['email'], "Subject", "Message", $headers);
请帮我解决这个问题! :)
这是从我的共享托管提供商服务器发送的。
如果我添加下面的第五个参数会有帮助吗?
"-f [email protected]"
最佳答案
你读过这篇文章吗?
So You'd Like to Send Some Email (Through Code)
简而言之:
- 确保发送电子邮件的计算机具有反向 PTR 记录
- 在您的 DNS 和代码中配置域名 key 识别邮件
- 在您的 DNS 中设置 SenderID 记录
关于php - 为什么我的电子邮件仍然被视为垃圾邮件?使用mail()函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3515769/