Validity of an e-mail address

  • Thread starter Thread starter H. Martins
  • Start date Start date
H

H. Martins

Hi,

Is there somewhere a routine to check potential validity of an e-mail
address?

That seems quite boring to write - someone has probably gone through
that already.

Thanks
Henry
 
H. Martins said:
Hi,

Is there somewhere a routine to check potential validity of an e-mail
address?

That seems quite boring to write - someone has probably gone through
that already.


I use this:

'----- start of code -----
Function IsValidEmailAddress(Candidate As String) As Boolean

If Trim(Candidate) Like "?*@[!.]*.[!.]*" Then
If Not Candidate Like "*@*@*" Then
IsValidEmailAddress = True
End If
End If

End Function
'----- end of code -----

It's simple, though not complete -- it's possible that an invalid e-mail
address could pass the tests, but unlikely, and it's not possible (I think)
for a valid one to fail. I believe one can do a more comprehensive job
using a regular expression, but that's always seemed like overkill to me.
 
Back
Top