PDA

View Full Version : Problem with Send Mail Contact Form (PHP and Flash)


Mat10681
08-08-2003, 09:40 AM
I downloaded the files relating to the "Send Mail Contact Form (PHP and Flash)" and changed the php file to reflect my own email. My php file now looks like this:

<?php
mail("[email protected]", $subject, $message, "From: PHPMailer\nReply-To: $from\nX-Mailer: PHP/" . phpversion());
?>

I also renamed the php file from mail.php3 to mail.php.

I also changed the action on the button in the mailer.fla file to reflect the change form mail.php3 to mail.php. The action on the button now looks like this:

on (release) {
if (subject eq "" or message eq "" or from eq "") {
stop();
} else {
lineAdapt();
loadVariablesNum("mail.php", 0, "POST");
gotoAndStop(2);
}
}

I've uploaded both the mailer.swf and mail.php file to the public_html directory of my Spaceports account but when i run the mailer.swf file and submit the form i don't receive any emails. I've also tried it with a non-http mail server (i.e. not hotmail) but i still don't get any emails. HELP!!! :confused::confused:

catbert303
08-10-2003, 03:32 PM
If you not recieving anything (not even blank emails) it might suggset that the host doesn't support PHP (or if it does they haven't configured it to send email)

To begin try creating the following script,

<?php
phpinfo();
?>

and uploading it to the server (call it something like info.php).

when you try to open this file in your web browser what do you see? if PHP is running you should get a page describing the version of PHP running and the settings being used.

freddycodes
08-10-2003, 08:52 PM
Most likely this is due to the way PHP is configured to read variables from a query string. The tutorial assumes your PHP setup is with rgeister_globals On, most new configs don't have that setup, which is a good thing nonetheless.

Anyways you'll need to access your variables through the $_POST array instead of directly.

See my post in this thread.
http://www.actionscripts.org/forums/showthread.php3?s=&threadid=31296&perpage=15&highlight=registerglobals&pagenumber=2

http://www.actionscripts.org/forums/showthread.php3?s=&threadid=29642&highlight=registerglobals

http://www.actionscripts.org/forums/showthread.php3?s=&threadid=25653&highlight=registerglobals

Mat10681
08-11-2003, 08:44 AM
Freddycodes, i looked at the threads you suggested made the changes but i'm still not receiving any of the emails. I'm sure that the server supports PHP cause i've checked. The php file now looks like this:

<?php
$email = "[email protected]";
$subject = "Mail from Spaceport Site";
$message = $_POST['message'];
$from = $_POST['from'];
$headers = "From: PHPMailer\nReply-To: $from\nX-Mailer: PHP/\nMIME-Version: 1.0\nContent-type: text/html; charset=iso-8859-1";

mail($email, $subject, $message, $headers);
?>

The action on the button in the fla file is as follows:

on (release) {
loadVariablesNum("mail.php", 0, "POST");
}

Both the swf and php files are in the same directory on the server and i'm still not getting any of the email. It won't allow me to attach the swf for you to look at but i've got two input text fields. One for the user to enter their email with the variable name "from" and one for the user to enter comments with the variable name "message". Why isn't it working???? :confused: Thanks.

freddycodes
08-11-2003, 10:17 AM
Why isn't it working???? Thanks


Ahh the most magical of questions:rolleyes:

There are way too many unknowns to answer that here. Why don't you just try a plain old php script with no flash movie in the equation and see if you can receive emails. Also I would slim up the headers until you have everything working.


<?php
$email = "[email protected]";
$subject = "Mail from Spaceport Site";
$message = "Test Email";
$from = "[email protected];
$headers = "From: $from\nReply-To: $from\nContent-type: text/plain; charset=iso-8859-1";
if(mail($email, $subject, $message, $headers)) {
print "Mail sent";
}
else {
print "Error sending Email";
}
?>



Now just view that PHP script in your browser and see what happens.

Mat10681
08-12-2003, 12:03 PM
Freddycodes, i copied and pasted the php code u suggested and uploaded to my server. When i run it i got the following error:

"Parse error: parse error, unexpected T_STRING in /home2/matpan/public_html/mail.php on line 6"

What does this mean?!?

catbert303
08-12-2003, 12:19 PM
A parse error usually means a typo somewhere in the code,

notice the line,

$from = "[email protected];

is missing the closing "

$from = "[email protected]";

should fix it.

Mat10681
08-12-2003, 02:30 PM
Now i'm simply getting an "Error sending Email" message when i run the script. Ahhhh!. What's wrong with this things?!?