电子邮箱email验证实例程序
function IsValidEmail(email)
dim names name i c
Check for valid syntax in an email address
IsValidEmail = true
names = Split(email "@")
if UBound(names) <> then
IsValidEmail = false
exit function
end if
for each name in names
if Len(name) <= then
IsValidEmail = false
exit function
end if
for i = to Len(name)
c = Lcase(Mid(name i ))
if InStr("abcdefghijklmnopqrstuvwxyz_" c) <= and not IsNumeric(c) then
IsValidEmail = false
exit function
end if
next
if Left(name ) = "" or Right(name ) = "" then
IsValidEmail = false
exit function
end if
next
if InStr(names() "") <= then
IsValidEmail = false
exit function
end if
i = Len(names()) InStrRev(names() "")
if i <> and i <> then
IsValidEmail = false
exit function
end if
if InStr(email "") > then
IsValidEmail = false
end if
end function