Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 08-08-2003, 09:40 AM   #1
Mat10681
Registered User
 
Join Date: Aug 2003
Posts: 7
Default Problem with Send Mail Contact Form (PHP and Flash)

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!!!
Mat10681 is offline   Reply With Quote
Old 08-10-2003, 03:32 PM   #2
catbert303
member
 
catbert303's Avatar
 
Join Date: Nov 2002
Location: uk
Posts: 428
Default

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.
catbert303 is offline   Reply With Quote
Old 08-10-2003, 08:52 PM   #3
freddycodes
Master of Nothing
 
Join Date: Dec 2002
Location: San Diego, CA
Posts: 2,468
Default

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/...s&pagenumber=2

http://www.actionscripts.org/forums/...egisterglobals

http://www.actionscripts.org/forums/...egisterglobals
freddycodes is offline   Reply With Quote
Old 08-11-2003, 08:44 AM   #4
Mat10681
Registered User
 
Join Date: Aug 2003
Posts: 7
Default Still not getting the emails

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???? Thanks.
Mat10681 is offline   Reply With Quote
Old 08-11-2003, 10:17 AM   #5
freddycodes
Master of Nothing
 
Join Date: Dec 2002
Location: San Diego, CA
Posts: 2,468
Default

Quote:
Why isn't it working???? Thanks
Ahh the most magical of questions

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 Code:
<?php 
$email 
"[email protected]";
$subject "Mail from Spaceport Site";
$message "Test Email";
$from "[email protected];
$headers = "From$from\nReply-To$from\nContent-typetext/plaincharset=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.
freddycodes is offline   Reply With Quote
Old 08-12-2003, 12:03 PM   #6
Mat10681
Registered User
 
Join Date: Aug 2003
Posts: 7
Default

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?!?
Mat10681 is offline   Reply With Quote
Old 08-12-2003, 12:19 PM   #7
catbert303
member
 
catbert303's Avatar
 
Join Date: Nov 2002
Location: uk
Posts: 428
Default

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.
catbert303 is offline   Reply With Quote
Old 08-12-2003, 02:30 PM   #8
Mat10681
Registered User
 
Join Date: Aug 2003
Posts: 7
Default

Now i'm simply getting an "Error sending Email" message when i run the script. Ahhhh!. What's wrong with this things?!?
Mat10681 is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:51 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.