I've had a LOT of trouble getting a PHP mailform to work on the server. I've looked at the FAQ under PHP/Pearl Settings, but it only addresses formmail PHP scripts, and I'm using a PHP form that is communicating with a .swf form using Actionscript. The following is the code I'm trying to use.
PHP:
Code:
<?PHP
$to = "mailexamplephp@yahoo.com";
$subject = "Flash Contact Form Submission";
$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;
?>
And here's the corresponding Actionscript inside the mailform:
Code:
stop();
var senderLoad:LoadVars = new LoadVars();
var receiveLoad:LoadVars = new LoadVars();
sender.onRelease = function() {
senderLoad.theName = theName.text;
senderLoad.theEmail = theEmail.text;
senderLoad.theMessage = theMessage.text;
senderLoad.sendAndLoad("http://leebrimelow.com/mailExample/send.php",receiveLoad);
}
receiveLoad.onLoad = function() {
if(this.sentOk) {
_root.gotoAndStop("success");
}
else {
_root.gotoAndStop("failed");
}
}
This is the code from the tutorial I've used - I'm at work right now. But in my code, I have the email being sent to my freehostia email address, which is forwarding to my personal email. Just can't get it to work at all. When I enter info on the mailform and submit it, the mail just dead-ends as soon as it hits the PHP. Please help!!