Validating an email address
Questions like how to verify or validate a Yahoo based email addresses.
Yahoo, as many of you know, is popular email service provider.
A complex regex validation on the email address doesn’t introduce an additional solution, it introduces an additional problem.
Obviously there are expressions that you could use to determine if the format of an e-mail address is valid but you can also use the System.
Here’s a fairly common code sample from Rails Applications with some sort of authentication system: If you’re experienced at Regex, this seems simple. Sections 3.2.4 and 3.4.1 of the RFC go into the requirements on how an email address needs to be formatted and, well, there’s not much you can’t do in your email address when quotes or backslashes are involved.
If (like me when I first saw this) you AREN’T experienced at Regex, it takes a while to parse. The local string (the part of the email address that comes before the @) can contain any of these characters: is a valid email address. For this reason, for a time I began running any email address against the following regular expression instead: Simple, right? This is often the most I do and, when paired with a confirmation field for the email address on your registration form, can alleviate most problems with user error.
They can get ridiculously convoluted as in the case above and, according to the specification, are often too strict anyway.
If you actually check the Google query I linked above, people have been writing (or trying to write) RFC-compliant regular expressions to parse email addresses for years.
Instead, I have another (tiny) library that can be used for that which is written in accordance with the specification: Email Validation It's a fairly simple class that implements an actual email address tokenizer instead of using error-prone regexes that no one seems to ever get hello deepak, you cant check that ..because many browsers does not support this kind of functionality ..still you can give it try ..check this : I have been doing the same in my projet.
They provide you with a reasonably good webmail service that is relatively easy to use and manage.
With such popularity, many customers signing up for your services or product enter their Yahoo email address in the sign-up field.
I validate the email address at the client side by using the Regular Expression validator.
Then in the code behind I write the code to send the mail and I am sending synchronous mail (which actually responds when mail is received at the receiver end).