I have a simple textbox with an email address.
I need to know the best and easiest way to find out whether that email address is valid or not. I want to know how I can do that.
I have tried using the below code but it does not display any message for me? Can anyone point the mistake I am making?
Public Function IsValidEmailAddress(ByVal email As String) As Boolean
Try
Dim ma As New MailAddress(email)
MsgBox(True, MsgBoxStyle.Information)
Catch
MsgBox(False, MsgBoxStyle.Information)
End Try
End Function
I am calling this function like this:
Call IsValidEmailAddress(txtEmail.txt)