Email validation in grid

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi

Is there anyway to validate an email address when typed in a field in grid
to stop people from entering invalid email addresses? Is there a way to do a
reverse dns lookup as well?

Thanks

Regards
 
Hi,

I would use a regular express to check if you have a valid email

Dim regEmail As New
System.Text.RegularExpressions.Regex("^((?:(?:(?:[a-zA-Z0-9][\.\-\+_]?)*)[a-zA-Z0-9])+)\@((?:(?:(?:[a-zA-Z0-9][\.\-_]?){0,62})[a-zA-Z0-9])+)\.([a-zA-Z0-9]{2,6})$")
Trace.WriteLine(regEmail.IsMatch("test.com"))
Trace.WriteLine(regEmail.IsMatch("(e-mail address removed)"))


Method by Carl Franklin
http://www.franklins.net/dotnet/MailChecker.zip

Ken
 
Back
Top