PDA

View Full Version : email form not sending


bullettobinary
06-22-2005, 02:52 AM
i have a simple email form i'm trying to put up in a web site made with flash mx 2004. i am having problems with the form sending the e-mail.
the code for the php is:

<?
$subject = $_POST['subject'];
$message = $_POST['message'];
$from = "From: ".$_POST['name']." <".$_POST['email'].">";
$to = "jaredconsumer@gmail.com";
if (isset($_POST['reply']) && $_POST['reply']=="1") $message .= "\n\nReply Requested";

/* and now mail it */
$mail_success = mail($to, $subject, $message, $from);
if ($mail_success == true) {
echo '&faultCode=0&';
} else {
echo '&faultCode=1&';
}
?>


thanks for you time,
jared

Billystyx
06-23-2005, 12:05 PM
do this for testing:

in your php file, right after the $_POST lines and declaration of the variables, add

echo $subject;
echo $from;
echo $To;
echo $message;

now upload it and navigate to it in your browser (the php file, not the flash).

Are all four variables showing in the browser window?

If not, then one or more is not coming over from flash, and the mail function won't work.

billystyx

bullettobinary
06-24-2005, 02:13 AM
ok this is what i did and i went into the email and i tryed it, it wouldn't work. then i navigated to the php and it doesn't do anything different. i have tryed 3 or 4 different tutorials for an email form and still cant get it to work.



<?
$subject = $_POST['subject'];
$message = $_POST['message'];
$from = "From: ".$_POST['name']." <".$_POST['email'].">";
$to = "jaredconsumer@gmail.com";
echo $subject;
echo $from;
echo $To;
echo $message;
if (isset($_POST['reply']) && $_POST['reply']=="1") $message .= "\n\nReply Requested";

/* and now mail it */
$mail_success = mail($to, $subject, $message, $from);
if ($mail_success == true) {
echo '&faultCode=0&';
} else {
echo '&faultCode=1&';
}
?>

mmm..pi..3.14..
06-24-2005, 04:33 AM
Well, if you can email via PHP and have the proper permissions, you should be able to strip my code out of my guestbook. You can also test it if you want from the site. Just choose to download the email guestbook ;)

http://members.lycos.co.uk/flashphpguestbook/

Eric

Billystyx
06-24-2005, 11:13 AM
if you are still having trouble, post your flash code for the sendAndLoad

that (I would say) is where the trouble is.
When you say it didn't do anything different when you navigated to the php page, did it echo those variables or not?
billystyx

bullettobinary
06-25-2005, 02:38 AM
no it didn't echo anything.
when i try these tutorials i never know what code needs to be where in the flash.

pad
06-25-2005, 11:35 PM
bullettobinary,

Does your hosting package include php?

bullettobinary
06-27-2005, 11:06 AM
yes, it does. it's godaddy.com

Billystyx
06-27-2005, 11:23 AM
to test the php is actually receiving your variables - you will probably need to change the as to a getURL, so it opens the php page, rather than a loadVariables type thing.

Can you also post your action script here?

billystyx