Home All Groups Group Topic Archive Search About

Email validation in grid

Author
7 Mar 2006 9:37 PM
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

Author
8 Mar 2006 12:14 AM
Ken Tucker [MVP]
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("t***@test.com"))


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

Ken
------------
Show quoteHide quote
"John" <John@nospam.infovis.co.uk> wrote in message
news:eRAn68iQGHA.1160@TK2MSFTNGP09.phx.gbl...
> 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
>