This is an e-mail address validation function. It allows the usual user@domain syntax, but in addition allows user@[ip] format as well as "User with Spaces"@domain or [ip], all of which are legal syntax, according to W3C. It also checks that the user hasn't done anything silly like having multiple @'s or continuous .'s in the address (e.g. jim@email@example.com and jim@c..b.co.uk).
Once more e-mail validator. This script willn't allow a user to type incorrect e-mail address in your form (in a reasonable limits of course)