function IsValidEmail(email)
dim names,name,i,c
IsValidEmail=true
names=split(email,"@")
if UBound(names)<>1 then
IsValidEmail=false
exit function
end if
if IsNumeric(right(email,1)) then
IsValidEmail=false
exit function
end if
for each name in names
if len(name)<=0 then
IsValidEmail=false
exit function
end if
for i=1 to Len(name)
c=Lcase(mid(name,i,1))
if InStr("abcdefghijklmnopqrstuvwxyz_-.",c)<=0 and not IsNumeric(c) then
IsValidEmail=false
exit function
end if
next
if Left(name,1)="." or right(name,1)="." then
IsValidEmail=false
exit function
end if
next
if Instr(names(1),".")<=0 then
IsValidEmail=false
exit function
end if
i=len(names(1))-InstrRev(names(1),".")
if i<>2 and i<>3 then
IsValidEmail=false
exit function
end if
if instr(email,"..") > 0 then
IsValidEmail=false
end if
end function
我用的,给你试试!