************************************************** 函数名:IsValidEmail 作 用:检查Email地址合法性 参 数:email ----要检查的Email地址 返回值:True----Email地址合法 False----Email地址不合法 ************************************************** function IsValidEmail(email) dim names, name, i, c IsValidEmail =true names =Split(email, "@") ifUBound(names) <>1then IsValidEmail =false exitfunction endif foreach name in names ifLen(name) <=0then IsValidEmail =false exitfunction endif for i =1toLen(name) c =Lcase(Mid(name, i, 1)) ifInStr("abcdefghijklmnopqrstuvwxyz_-.", c) <=0andnotIsNumeric(c) then IsValidEmail =false exitfunction endif next ifLeft(name, 1) ="."orRight(name, 1) ="."then IsValidEmail =false exitfunction endif next ifInStr(names(1), ".") <=0then IsValidEmail =false exitfunction endif i =Len(names(1)) -InStrRev(names(1), ".") if i <>2and i <>3then IsValidEmail =false exitfunction endif ifInStr(email, "..") >0then IsValidEmail =false endif end function