PHP mailer problem

Created a simple contact mailer using the loadVariable(“email.php”, “POST”) action on a send button, I have a EmailStatus message that is displayed after you press the button but the PHP will not work code:

<?php 
$sendTo = "[EMAIL="acondon747@yahoo.com"]acondon747@yahoo.com[/EMAIL]"; 
$subject = "Support Form";
$headers = "From: " . $_POST["name"];
$headers .= "Subject: " . $_POST["subject"];
$headers .= "<" . $_POST["email"] . ">
"; 
$headers .= "Reply-To: " . $_POST["email"] . "
"; 
$headers .= "Return-Path: " . $_POST["email"]; 
$message = $_POST["message"];
mail($sendTo, $subject, $message, $headers);
Print _root.EmailStatus="Complete - Your message has been sent";
?>

Button code

on (release) {
 if (!email.length || email.indexOf("@") == -1 || email.indexOf(".") == -1) {
  _root.EmailStatus = "Please enter a valid E-mail address";
 } else if (!name.length) {
  _root.EmailStatus = "Please Enter your name before Sending";
 } else if (!message.length) {
  _root.EmailStatus = "Please enter some text in you message";
 } else if (!subject.length) {
  _root.EmailStatus = "Please enter a subject for your message";
 } else {
  loadVariables("email.php", "POST");
  _root.EmailStatus = "Message is being sent please wait...";
  loading = "YES";
  _this.gotoAndPlay(2);
 }

In the form movie clip there are 3 frames 1st frame (stop()) ,2nd frame (just a keyframe),
3rd frame

if (loading eq "YES") {
 gotoAndPlay(_currentframe-1);
} else {
 _this.gotoAndStop(1);
}

I know the button works but there is no contact to the php im running on Mosso so I know it will run php both index.html and email.php are in the same root directory on the site. Where is the problem? Thanks in advance

That code you have there is a bit messed up. Doesn’t need to be that complicted. Mail forms are so easy to use. Here’s a very simple one I made, you can use it if you want. Just change the first line in the email.php file to aim at your email address.
Oh, and change the ‘subject’ line also (the second line in the php file!

Sorry, posted the wrong email form. Here’s the right one.

thank you for the quick response the code you gave me worked after I broke apart the symbol all the form and buttons were on I forgot that forms needed to be on the _root to work properly thank you though…

Ok I forgot how to get spaces in the PHP now when the email is recieved it shows up like this

 
Wrappitty Wrappitty
Its me
Does it wrap yo?It does when you press enter but if you keep typing 
HOLY CRAP IT WORKS NOW whyNOBODY KNOWS!!!

I pressed enter where there are no spaces in the message box, but I need spaces in between the 3 lines, (Wrappitty Wrappity [“subject”], Its me [“name”], and the message [“messagepost”]. I did this on another site I made but don’t the PHP at hand right now.

I messed up my original code on my php file. If you download it again (new version) and look at the php file you will see how I put line breaks in between each text box entry. (you need to add
) to your code in the php.
Or post the php code here and I’ll fix it.