here is how I would write that... only some minor cosmetic changes... I'm not so sure about that last Print statement. I'm guessing it's supposed to pass that value back to the swf, but I haven't used that method before so I'm not sure. You might also want to check your error_log file to see if there might be a php error that isn't getting shown. That might give you a little more information as to what's failing.
Edit:: You probably should scrub your $_POST input to make sure that malicious code isn't used to send spam through your form. Sometimes they add a \r\n to an input to add additional email values and to send garbage. Limit the character count of the input, and which characters are acceptable (block the \ from the posts) and you should be safer.