- Home
·
- String Manipulation
·
- Validate Email ID (updated) This function validates the emailID string and returns a boolean value
Validate Email ID (updated) This function validates the emailID string and returns a boolean value
Validate Email ID (updated) This function validates the emailID string and returns a boolean value
API Declarations
if ValidateEmail("[email protected]") then
'valid id
else
'invalid id
end if
Rate Validate Email ID (updated) This function validates the emailID string and returns a boolean value
(1(1 Vote))
Dim m, n, o, i
If InStr(sEmail, "@") > 0 Then
For i = 1 To Len(sEmail)
If InStr("[email protected]_", lcase(Mid(sEmail, i, 1))) > 0 Then
Else
ValidateEmail = False
Exit Function
End If
Next
m = Split(sEmail, "@")
If UBound(m) > 1 Then
ValidateEmail = False
Exit Function
End If
o = Split(m(0), ".")
For i = 0 To UBound(o) ' - 1
If Len(o(i)) < 1 Then
ValidateEmail = False
Exit Function
End If
Next
For i = 0 To UBound(m) - 1
If Len(m(i)) < 2 Then
ValidateEmail = False
Exit Function
End If
Next
If InStr(m(1), ".") > 0 Then
n = Split(m(1), ".")
For i = 0 To UBound(n) ' - 1
If Len(n(i)) < 2 Then
ValidateEmail = False
Exit Function
End If
Next
Else
ValidateEmail = False
Exit Function
End If
Else
ValidateEmail = False
Exit Function
End If
ValidateEmail = True
end function
Validate Email ID (updated) This function validates the emailID string and returns a boolean value Comments
No comments yet — be the first to post one!
Post a Comment