You are on page 1of 1

Public Function IsValidEmail(ByVal email As String)

As Boolean
If email = String.Empty Then Return False
' Compruebo si el formato de la direccin es
correcto.
Dim re As Regex = New Regex("^[\w._%-
]+@[\w.-]+\.[a-zA-Z]{2,4}$")
Dim m As Match = re.Match(email)
Return (m.Captures.Count <> 0)
End Function



Private Sub BtnEnviar_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs)
Handles BtnEnviar.Click
Dim bln As Boolean =
IsValidEmail(txtPara.Text)
If bln = False Then
MessageBox.Show("Verifique Email
Formato Incorrecto")
txtPara.Focus()
Exit Sub
End If

End If

You might also like