PHP mail form checking valid email?

Hello I have a working flash php mailing form but the only problem is that I put some code in there to check if the email is valid before it sends it off but it doesn’t seem to work. I did a test by just putting in a as the email and that worked, sent off the email without giving an error.


        mailReceiver.onLoad = function() {
            if (this.response == "invalid") {
                mainTL.gotoAndStop(1);
                alert_txt.text = "Please check email address - does not appear valid."
            } else if (this.response == "passed") {
                mainTL.gotoAndStop(4);
            }
        }

Is is possible to check if its valid before it sends off or is there another method for checking valid email addresses. I used that code from thegoldenmean.com website.

Cheers,
Inept