Validate email id at server side


This function validates email id at the server side.Pass the email id as parameter to the function ValidateEmailId.Email id is validated using the function regularexpression.

This function validates email id at the server side.Pass the email id as parameter to the function ValidateEmailId.Email id is validated using the function regularexpression.


Public Function ValidateEmailId(ByVal strEmail As String) As Boolean
Dim strEmailStandard As String = "^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,4}$"

Return System.Text.RegularExpressions.Regex.IsMatch(strEmail, strEmailStandard)
End Function


Comments

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:
    Email: