为什么我的电子邮件仍然被视为垃圾邮件?使用mail()函数

发布于 2024-09-15 03:19:51 字数 1167 浏览 2 评论 0原文

我对此感到非常恼火,因为无论垃圾邮件过滤器看起来如何,仍然将我的网站自动回复器称为垃圾邮件。我已经正确设置了所有标题,这就是我到目前为止所拥有的!

$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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

谈情不如逗狗 2024-09-22 03:19:51

你读过这篇文章吗?

所以你“想要发送一些电子邮件(通过代码)

简而言之:

  1. 确保发送电子邮件的计算机具有反向 PTR 记录
  2. 在您的 DNS 和代码中配置域名密钥识别邮件
  3. 在您的 DNS 中设置 SenderID 记录

Have you read this?

So You'd Like to Send Some Email (Through Code)

In a nutshell:

  1. Make sure the computer sending the email has a Reverse PTR record
  2. Configure DomainKeys Identified Mail in your DNS and code
  3. Set up a SenderID record in your DNS
汹涌人海 2024-09-22 03:19:51

有很多因素会导致交付问题。浅谈一下:

  • 主题行?
  • 消息正文?
  • 您的 PTR 记录正确吗?
  • 您是否设置并配置了 SPF/发件人 ID/DKIM/域密钥?
  • 您的发送 IP 是否被列入黑名单? (senderbase.org 是检查信誉的好方法。mxtoolbox.com 非常适合检查常见的黑名单状态。)

大多数垃圾邮件软件都会将标头附加到标记为垃圾邮件的邮件中。您可以查看这些内容以获取更多信息/它们被标记为垃圾邮件的原因。

There are a huge amount of things that contribute to deliverability issues. To scratch the surface:

  • Subject line?
  • Message Body?
  • Are your PTR records correct?
  • Do you have SPF / Sender ID / DKIM / Domain keys setup and configured?
  • Are your sending IPs blacklisted? (senderbase.org is a good way to check reputation. mxtoolbox.com is nice for checking common blacklist status.)

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.

旧街凉风 2024-09-22 03:19:51

这是家庭 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.

葬シ愛 2024-09-22 03:19:51

反向查找您的 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.

鸠魁 2024-09-22 03:19:51

您在评论中提到您正在使用共享托管:就垃圾邮件过滤器而言,您受到了巨大的打击。现在,大多数收件人都会执行反向 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:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文