Imports System.Text.RegularExpressions
The function:
Function IsValideEmail(ByVal email As String) As Boolean
Dim pattern As String = "^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$"
Dim EmailMatch As Match = Regex.Match(email, pattern)
If EmailMatch.Success Then
Return True
Else
Return False
End If
End Function
This is an example of how to use this function:
Sub SendEmail()
If IsValideEmail("your email address") = False Then
MsgBox("Incorrect Email Address!")
Exit Sub
End If
'send email code goes here
End Sub




