AS3 PHP Contact Form - Server Side Flash

I’ve been working on a small commercial website (my first) and I’m having some trouble accessing a a simple PHP mail script from a flash interface.

I’m not proficient in PHP in fact I’m just beginning to learn. The site can be viewed [COLOR=YellowGreen]here.[/COLOR]

This is the PHP script and its possibly error ridden but I wouldn’t be sure:

<?php
$sendTo = "test@mydomain.com";

$senderName = "";
$replyAddress = "";
$subject = "";
$messageBody = "";

$headers = "From: " . $senderName . " <" . $replyAddress . ">
";

mail($sendTo, $subject, $messageBody, $headers);

?>

I’m aware that it may not be possible to send mail outside of the sites domain (or something like that), depending on the server settings. However I’ve tried other things with no results.

The AS3 code is as follows:


stop();
var enableSubmit:Boolean = true;
var verified:Boolean = false;
var messageType:String = "QUERY";

senderName_TB.restrict ="A-Z a-z' \\-";
replayAdress_TB.restrict ="0-9 a-z @_.";
telephone_TB.restrict ="0-9 +";

//=========================[FUCNTIONS]=========================================
//
//-------------------------[SUBMIT MESSAGE]-------------------------------------
submitBTN.addEventListener(MouseEvent.MOUSE_DOWN, submitMessage);

function submitMessage(mEvent:MouseEvent):void {
    inputCheck();
    if (enableSubmit) {
        enableSubmit = false;
        var popUp:MovieClip;
        if (verified) {
            var variables:URLVariables = new URLVariables();

            variables.senderName = senderName_TB.text;
            variables.replyAddress = replayAdress_TB.text + " ("+telephone_TB.text+") ";
            variables.subject = typeSelect.messageType + subject_TB.text;
            variables.messageBody = messageBody_TB.text;

            var scriptRequest:URLRequest = new URLRequest("processQuery.php");
            scriptRequest.data = variables;

            var scriptLoader:URLLoader = new URLLoader();
            scriptLoader.addEventListener(Event.COMPLETE, messageSent);
            scriptLoader.addEventListener(IOErrorEvent.IO_ERROR, sendingFailed);
            scriptLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, sendingFailed);

            scriptRequest.method = URLRequestMethod.GET;
            scriptLoader.load(scriptRequest);

            function messageSent(tEvent:Event):void {
                popUp = new submitNotification();
                messageHolder.addChild(popUp);
                senderName_TB.text;
                senderName_TB.text = replayAdress_TB.text = telephone_TB.text = subject_TB.text = messageBody_TB.text ="";
                popUp.addEventListener(MouseEvent.CLICK, popUpClicked);
            }
            function sendingFailed(tEvent:Event):void {
                popUp = new serverNotificationError();
                messageHolder.addChild(popUp);
                popUp.addEventListener(MouseEvent.CLICK, popUpClicked);
            }
        }
        else {
            popUp = new submitNotificationError();
            messageHolder.addChild(popUp);
            popUp.addEventListener(MouseEvent.CLICK, popUpClicked);
        }
        function popUpClicked(mEvent:MouseEvent):void {
            popUp.removeEventListener(MouseEvent.CLICK, popUpClicked);
            messageHolder.removeChild(popUp);
            enableSubmit = true;
        }
    }
}
//-------------------------[IMPUT CHECKING]----------------------------------------
function inputCheck():void {
    if (replayAdress_TB.length ==0 && telephone_TB.length ==0) {
        verified = false;
    }
    else if (replayAdress_TB.length != 0 &&(replayAdress_TB.text.indexOf("@",3) ==-1||replayAdress_TB.text.indexOf(".",6) ==-1||replayAdress_TB.text.length<11)) {
        verified = false;
    }
    else if (telephone_TB.length !=0 && telephone_TB.length < 10) {
        verified = false;
    }
    else if (senderName_TB.length < 2 || subject_TB.length < 3 || messageBody_TB.length < 10) {
        verified = false;
    }
    else {
        verified = true;
    }
}

[COLOR=Red]

[COLOR=Black]I no longer receive error codes from IE7 and it finally sends the mail however the message is blank with no headers body or any other information.[/COLOR]

[COLOR=Black]Any assistance would be greatly appreciated. :huh:

[/COLOR]

[/COLOR]