Hey

I'm tryin to make a form in Flash and it gets an email from XML and then sends a message to it using PHP.

My actionscript:

Code:
senderLoad.theName = txtName.text;
senderLoad.theEmail = txtEmail.text;
senderLoad.theDept = xml.firstChild.childNodes[1].childNodes[cboDept.selectedIndex].attributes.mailbox;
senderLoad.theMessage = txtMsg.text;
So the different components on the flash form are put into variables.

My PHP code:

Code:
<?PHP

$to = $theDept;
$subject = "Contact form query";
$message = "Name: " .$theName;
$message .= "\nEmail: " .$theEmail;
$message .= "\n\nMessage: " .$theMessage;

$headers = "From: $theEmail";
$headers .= "\nReply-To: $theEmail";

$sentOk = mail($to, $subject, $message, $headers);

echo "sentOk=" .$sentOk;

?>
So what is happening (in the first line) is that I want whatever theDept is (should be an email pulled from XML file) to be set as *where* the message needs to be sent to. That is why I have set it to $to variable.

This is not sending however and I think it is because of that $to line - can anyone advise if the code is right or not?

Thx