Foreslag til forbedringer ?
HejsaEr der nogen der kan komme med forslag til forbedringer af denne function til valideing af email adresser ?
Function ValidateEmail(email)
Dim atCnt
ValidateEmail = False
If Len(cstr(Email)) < 7 Then
ValidateEmail = True
Elseif instr(Email,"@") = 0 Then
ValidateEmail = True
Elseif instr(Email,".") = 0 Then
ValidateEmail = True
Elseif len(Email) - instrrev(email,".") > 3 Then
ValidateEmail = True
Elseif instr(Email,"_") <> 0 and _
instrrev(Email,"_") > instrrev(Email,"@") Then
ValidateEmail = True
Elseif Left(Email,4) = "www." Then
ValidateEmail = True
Else
atCnt = 0
For i = 1 to Len(Email)
If Mid(Email,i,1) = "@" then
atCnt = atCnt + 1
End If
Next
If atCnt > 1 Then
ValidateEmail = True
End If
For i = 1 to Len(Email)
If Not isNumeric(Mid(Email,i,1)) And _
(lCase(Mid(Email,i,1)) < "a" Or _
lCase(Mid(Email,i,1)) > "z") And _
Mid(Email,i,1) <> "_" And _
Mid(Email,i,1) <> "." And _
Mid(Email,i,1) <> "@" And _
Mid(Email,i,1) <> "-" Then
ValidateEmail = True
End If
Next
End If
End Function
/vb-mo