dpleylxzx47207117 2012-03-21 16:35
浏览 55
已采纳

有没有办法使用PHP来检查我的邮件内容是否是垃圾邮件?

The idea is before i send the mail , I would like to use some code to check the content whether it use spam phrase . Here is some simple code

function isSpam($text)
{
    $pattern = "/\b(actual|filter|removed|because|it|contained|obscenities)\b/i";

    if(preg_match($pattern, $text, $match))
        return true;
    else
        return false;
}

The question are:

  1. Are there any way to improve the code such as check the occur time not only check if it is exist?

  2. Are there any plugin or code exist already so I do not have to redo it?

  3. Bayesian Spam Filter is all about a mail inbox ? Is it useful as an outgoing email filter?

Thank you for helping

  • 写回答

2条回答 默认 最新

  • dongrunying7537 2012-03-21 16:39
    关注

    you can check any content if it contains any spam messages with a nice to use plugin called Akismet it is free and used by most of the CMS and blogging application like wordpress etc.

    check out the link http://akismet.com/

    the library itself is very easy to implement, just download the library from there website and use the provided API from there documentation. and you are good to go. i have found this to be very effective for myself.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100