Im creating a contact form for my website using Actionscript 3.0 with Flash CS6, I have my code written down perfectly but in order to receive my messages towards my email ain't working :( Here is my code
<?php
$emailTo = "myemail@myemail.com";
$name = $_POST["Patrick"];
$emailFrom = $_POST["myemail@myemail.com"];
$message = $_POST["Hello"];
$subject = "From Contact Form";
if(!empty($_POST)) {
$body = "Name: " . $name . "
";
$body .= "Email: " . $emailFrom . "
";
$body .= "Message:
" . $message;
$body = wordwrap($body, 70);
$header = "From: " . $emailFrom . "
Reply-To: " . $emailFrom. "
";
if(mail($emailTo, $subject, $body, $header)) {
echo("result=Successful");
} else {
echo("result=Unsuccessful");
}
}
?>
Thanks and hope I you guys can help me
I think the problem lies in how you try to retrieve the $_POST
variables.
You're code suggests that you post fields with the names Patrick
, myemail@myemail.com
and Hello
. That wouldn't be logical.
So I guess that your code should be something like the following:
$emailTo = "myemail@myemail.com";
$name = $_POST["name"];
$emailFrom = $_POST["emailFrom"];
$message = $_POST["message"];
$subject = "From Contact Form";
Or for testing purposes (just to see if your mail script is working):
$emailTo = "myemail@myemail.com";
$name = "Patrick";
$emailFrom = "myemail@myemail.com";
$message = "Hello";
$subject = "From Contact Form";