how to validate the email address ?

Use Regex (Regular expression), here's the pattern I use:
VB.NET:
Friend Const g_strRegexEmailPattern As String = "\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
 
If you could upgrade to .Net 2.0 or newer you could also use the Net.Mail.MailAddress class for simple validation, something like this:
VB.NET:
Function GetMailAddress(ByVal address As String) As Net.Mail.MailAddress
    Try 
        Return New Net.Mail.MailAddress(address)
    Catch ex As Exception
        MessageBox.Show(ex.Message, address)
    End Try
    Return Nothing
End Function
 

Latest posts

Back
Top