Recognizing e-mail addresses is hard, bordering on impossible. The only real reference to what an e-mail address can look like is the SMTP specification (RFC 2821), and that is very forgiving. Anything on the form <localpart>@<domain> is acceptable.
I usually recommend going with just:
That accepts all of these (perfectly valid) addresses:
me+something@example.com me.something@[192.168.10.2] "Mr.Jones"@example.com The parts before the "@" should only ever be interpreted by the
receiving host, so you shouldn't try to rule something out (except
extra "@"'s). The part after the "@" can be a domain name or an
IP-address (both IPv4 and IPv6).
Also remember, that there is no way to ensure that an e-mail address
works, i.e., that it can receive mail, except trying to send to it
and receive an answer. On the other hand, it is far too easy to reject a perfectly good and working address, which will make the user of the page a lot of pain and cursing ... not something to aim for.
Aim to accept too much rather than too little. The worst that can happen is that the mail bounces or is lost, and that will probably happen for
foo@example.com too.
/L