时间: 2021-07-31 作者:daque
<%function isvalidemail(email)dim names, name, i, c'check for valid syntax in an email address.isvalidemail = truenames = split(email, "@")if ubound(names) <> 1 thenisvalidemail = falseexit functionend iffor each name in namesif len(name) <= 0 thenisvalidemail = falseexit functionend iffor i = 1 to len(name)c = lcase(mid(name, i, 1))if instr("abcdefghijklmnopqrstuvwxyz_-.", c) <= 0 and not isnumeric(c) thenisvalidemail = falseexit functionend ifnextif left(name, 1) = "." or right(name, 1) = "." thenisvalidemail = falseexit functionend ifnextif instr(names(1), ".") <= 0 thenisvalidemail = falseexit functionend ifi = len(names(1)) - instrrev(names(1), ".")if i <> 2 and i <> 3 thenisvalidemail = falseexit functionend ifif instr(email, "..") > 0 thenisvalidemail = falseend ifend function%>