I’m trying to validate emails but my code is not allowing a few scenarios..
Code
pvm = "bw.stack@domain.com" does not work
pvm = "user@gmail.com" - works
If Len(pvm) < 5 OR NOT Instr(1, pvm, " ") = 0 OR InStr(1, pvm, "@", 1) < 2 OR InStrRev(pvm, ".") < InStr(1, pvm, "@", 1) Then
blnEmailOKREG = False
Else
blnEmailOKREG = True
End If
Here is a fairly good valiation for email addresses. Please note though that its hard to get a completely ‘all-knowing’ validation.
_