| The following is the code fragment: <% 'Determine whether Email is correct Function isvalidemail (email) Dim names, name, i, C Isvalidemail = TRUE names = split (email, "@") If ubound (names) <> 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 %> |