IsEmail
Extend string with boolean test for a valid email address
Source
Module MyExtensions
<System.Runtime.CompilerServices.Extension()> _
Public Function IsEmail(ByVal text As String) As Boolean
Dim Expression As New System.Text.RegularExpressions.Regex("\S+@\S+\.\S+", System.Text.RegularExpressions.RegexOptions.Compiled)
If Expression.IsMatch(text) Then
Return True
Else
Return False
End If
End Function
End Module
Example
if textbox1.text.IsEmail then
sendmail(message)
end if