Trouble with 'enter valid email

i have looked through the forums and such for a way to verify that that the user has entered the correct format for their email and i am having no luck

all i want is set it so the when the user enters a mistyped email address it kicks it back the to the mail login.

for example:
[email protected]

when it should be:
[email protected]

any clues?

this is what i have so far for actionscript (but it doesnt work)
on (release) {
if (email.indexOf(" “) != -1 || email.indexOf(”@") == -1 || email.indexOf(".") == -1 ||email.length<6||email.lastIndexOf(".")<email.indexOf("@")) {
gotoAndStop (“wrongemail”);
} else {
loadVariablesNum (“consult.php”, 0, “POST”);
gotoAndStop (“valid”);
}
if (name eq “” or email eq “” or subject eq “”) {
gotoAndStop (“not”);
} else {
loadVariablesNum (“consult.php”, 0, “POST”);
gotoAndStop (“valid”);
}
}

even though i tried entering a wrong email address - my form still accepts that it is okay

thanks