Public Function IsValidemail (stremail as string) AS Boolean Dim Names, Name, I, C IsValidemail = true names = split (stremail, "@")
IF Ubound (Names) <> 1 Then IsValidemail = false exit function endiff
For Each Name in Names
IF len (name) <= 0 dam isvalidemail = false exit function endiff
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) = "." "The isvalidemail = false exit function endiff
NEXT
IF INSTR (Names (1), ".") <= 0 Then IsValidemail = false exit function endiff
I = LEN (Names (1)) - Instrrev (Names (1), ".")
IF i <> 2 and i <> 3 Then isvalidemail = false exit function endiff
If ISTR (Stremail, "..")> 0 damsValidemail = false exit function endiff
END FUNCTION