javascript验证邮件地址和MX记录的方法
本文实例讲述了javascript验证邮件地址和MX记录的方法。分享给大家供大家参考。具体如下:
// Tests for a valid email address and optionally tests for valid MX records, too. function is_valid_email($email, $test_mx = false) { if(eregi("^([_a-z0-9-]+)(\.[_a-z0-9-]+)*@([a-z0-9-]+)(\.[a-z0-9-]+)*(\.[a-z]{2,4})$", $email)) if($test_mx) { list($username, $domain) = split("@", $email); return getmxrr($domain, $mxrecords); } else return true; else return false; }
希望本文所述对大家的javascript程序设计有所帮助。
相关推荐
Rain 2020-06-25
88570299 2020-06-18
JasonYeung 2020-06-11
sunnyJam 2020-04-03
llwang0 2020-05-06
winmeanyoung 2020-04-11
vanturman 2020-04-08
keepdoingit 2020-02-23
mmyCSDN 2020-02-10
stulen 2020-01-21
zhouyuqi 2020-01-20
zhiyuan0 2020-01-18
zhangpan 2020-01-10
nanbiebao 2020-01-10
疯狂紫萧 2020-01-08
水痕 2019-12-05
peterlee 2011-07-26
codeAB 2019-10-31