PHP 知道电子邮件何时被标记为垃圾邮件
我不确定是否有办法做到这一点,但我注意到 ZOHO 目前提供了此功能,如果我将一封电子邮件标记为垃圾邮件,它会显示在 zoho 上,表示用户已将您的电子邮件标记为垃圾邮件。
我不确定 gmail、live 和其他电子邮件提供商的工作原理。
但我想如果他们这样做,我应该能够收到同样的通知......
am not sure if there is away to do this, but I noticed that ZOHO currently offers this feature, where if I mark an email as spam, it shows up at zoho saying a user has marked your email as spam.
I am not sure how this works, with gmail, live, and other email providers.
But I thought if they do it, I should be able to get the same notification...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
ZOHO 将拥有一个过滤算法,要么由其服务器上的现成程序运行,要么由他们自己编写。不幸的是,在 PHP 中,没有
is_spam($email)
方法,尽管它会很好。ZOHO will have a filtering algorithm either run by a ready-made program on their server, or they'll have written their own. Unfortunately, in PHP, there's no
is_spam($email)
method, although it'd be nice.如果幸运的话,您的电子邮件发送功能将向您提供错误代码 571,这意味着该消息“被安全策略/邮件过滤器拒绝”。
不过这种情况很少见,很可能您必须希望并等待服务器的回复/传送失败,并解析消息以查找 5.xx 代码。一个快速而肮脏的正则表达式: / 5(.)?[0-9]{1}(.)?[0-9]{1} /
但它并不可靠 - 有些服务器只是回复 550 'an' 错误发生,而有些邮件服务器礼貌地指定 5.7.1 = 我们认为您是垃圾邮件。
If you're lucky, your email send function will give you an error code 571 which means the message was "Rejected by security policy/mail filter".
This is rare though, most likely you'll have to hope and wait for a reply / delivery failure from the server and parse the message looking for a 5.x.x code. A quick and dirty regex: / 5(.)?[0-9]{1}(.)?[0-9]{1} /
It's not reliable though- some servers just reply with 550 'an' error occurred, whereas some mail servers politely specify 5.7.1 = we think you're spam.