使用MX检查进行电子邮件验证

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了使用MX检查进行电子邮件验证相关的知识,希望对你有一定的参考价值。

found this somewhere online...not the author, but works like a charm
  1. function checkEmail($email) {
  2. if(preg_match("/^([a-zA-Z0-9])+([a-zA-Z0-9._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9._-]+)+$/", $email)){
  3. list($username,$domain)=split('@',$email);
  4. if(!checkdnsrr($domain,'MX')) {
  5. return false;
  6. }
  7. else {
  8. return true;
  9. }
  10. }
  11. }

以上是关于使用MX检查进行电子邮件验证的主要内容,如果未能解决你的问题,请参考以下文章