Validating Email Controls

Imports System.Text.RegularExpressions

If txtEmail.Text<>"" Then

Dim reg as Match=RegularEx.Match(Trim(txtEmail.Text),"^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,3})$",RegularExOptions.IgnoreCase)

If reg.Success=False Then

MessageBox.Show("Please Enter A Valid Email Address",Information",MessageBoxButtons.OK,MessageBoxIcon.Information)

Exit Function

End If
End If

This code is for Validating Email Controls


No responses found. Be the first to comment...

  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name: