开发者

PHP know when an email is marked as spam

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 开发者_C百科thought if they do it, I should be able to get the same notification...


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜