为什么我的电子邮件仍然被视为垃圾邮件?使用mail()函数
我对此感到非常恼火,因为无论垃圾邮件过滤器看起来如何,仍然将我的网站自动回复器称为垃圾邮件。我已经正确设置了所有标题,这就是我到目前为止所拥有的!
$headers = "From: Name<[email protected]>\r\n"
."Return-Path: Name<[email protected]>\r\n"
."Reply-To: Name<[email protected]>\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 [电子邮件受保护]"
I've been getting very annoyed at this as no matter what it seems spam filters are still calling my websites auto responder as spam. I've set all my headers correctly and this is what I have so far!
$headers = "From: Name<[email protected]>\r\n"
."Return-Path: Name<[email protected]>\r\n"
."Reply-To: Name<[email protected]>\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);
Please help me on this one! :)
This is being sent from my shared hosting providers servers.
would it help if I added the 5th parameter as below?
"-f [email protected]"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
你读过这篇文章吗?
所以你“想要发送一些电子邮件(通过代码)
简而言之:
Have you read this?
So You'd Like to Send Some Email (Through Code)
In a nutshell:
有很多因素会导致交付问题。浅谈一下:
大多数垃圾邮件软件都会将标头附加到标记为垃圾邮件的邮件中。您可以查看这些内容以获取更多信息/它们被标记为垃圾邮件的原因。
There are a huge amount of things that contribute to deliverability issues. To scratch the surface:
Most spam software will append headers to the messages marked as spam. You can check those out for additional information / the reason why they are being marked spam.
这是家庭 IP 地址吗?我发现许多垃圾邮件过滤器会自动阻止来自看似家庭 IP 地址的电子邮件。
Is this on a home IP address? I've found that many spam filters will automatically block E-Mails coming from what looks like a home IP address.
反向查找您的 mx 记录也很重要。它来自的电子邮件地址(在您的示例中:website.com”最好从 website.com 的 mx 记录指向的服务器发送。
因此,如果我从地址 example.com 发送了一封电子邮件,但它已发送如果电子邮件地址的 IP 地址与发送地址不匹配,则 MX 记录的反向查找会失败。
您还可以使用 http://www.mxtoolbox.com/blacklists.aspx 检查您的域是否已被列入黑名单
。还有一些服务可以分析您的电子邮件是否被标记为垃圾邮件或垃圾邮件,只需在谷歌中搜索电子邮件垃圾邮件检查器即可。
Reverse lookup on your mx records are crucial too. The email address that it's coming from (in your example: website.com" better be sent from the server where the mx record for website.com points to.
So if I sent an email from the address example.com, but it was sent from a server hosted at website.com, then the reverse lookup on the MX record fails because it sees that the IP address for the email address doesn't match where it was sent from.
You can also use a service like http://www.mxtoolbox.com/blacklists.aspx to check if your domain has been blacklisted.
There are also services that will analyze your email for getting labeled as spam or junk. Just search google for email spam checker.
您在评论中提到您正在使用共享托管:就垃圾邮件过滤器而言,您受到了巨大的打击。现在,大多数收件人都会执行反向 DNS 查找,以确认发件人的 IP 地址和主机名是否匹配;这在共享主机上不会发生。
详细信息:
You mentioned in a comment that you're using shared hosting: that right there is a huge strike against you when it comes to spam filters. Most recipients now perform a reverse DNS lookup to confirm the IP address and the host name of the sender match up; which will not happen on shared hosting.
More info: