simplexian Posted May 18, 2008 Share Posted May 18, 2008 I am using Flash CS3 (Actionscript 3.0) to create a contact form. The problem in this case, is that the email is not being recieved for 10+ minutes. The browser hangs at "Transferring data from ...". With that said, the URLLoader does recieve the Event.COMPLETE, so the PHP file is recieving the variables from Flash correctly. I am assuming this is a timeout issue of some sort, but I am not finding any answers on the Actionscript forums. Here is the PHP file being used: <?php $name=$_POST['name']; $email=$_POST['email']; $message=$_POST['message']; $subject = 'Subject example'; $toaddress='[email protected]'; $name=trim($name); $email=trim($email); $subject=stripslashes($subject); $message=stripslashes($message); if(mail($toaddress,$subject,$message,'From: '.$name.' <'.$email.'>')){ echo 'response=passed'; } else { echo 'response=failed'; } ?> Link to comment https://forums.phpfreaks.com/topic/106134-solved-issue-with-as3-email-form-and-php-timeout/ Share on other sites More sharing options...
simplexian Posted May 18, 2008 Author Share Posted May 18, 2008 Additionally... to ensure it isn't the fault of flash, I made an html file to send the email, and exactly the same problem. 10-15 minutes to recieve email. Link to comment https://forums.phpfreaks.com/topic/106134-solved-issue-with-as3-email-form-and-php-timeout/#findComment-543986 Share on other sites More sharing options...
RichardRotterdam Posted May 18, 2008 Share Posted May 18, 2008 i dont think that is flash or php thats causing that. thats because youre mail server checks the mail every 10 min and sends it. it must be in a queue of some sort Link to comment https://forums.phpfreaks.com/topic/106134-solved-issue-with-as3-email-form-and-php-timeout/#findComment-544094 Share on other sites More sharing options...
simplexian Posted May 18, 2008 Author Share Posted May 18, 2008 It's not my mail server. To test to make sure my mail server wasn't backed up in the queue, I had a friend send numerous emails before, during, and after the email sent by the contact form. All emails sent by the friend were recieved almost instantly, while the email from the contact form isn't recieved until the timeout on the PHP file. Link to comment https://forums.phpfreaks.com/topic/106134-solved-issue-with-as3-email-form-and-php-timeout/#findComment-544373 Share on other sites More sharing options...
simplexian Posted May 18, 2008 Author Share Posted May 18, 2008 And this test has been done repeatedly. It's a constant incident. Link to comment https://forums.phpfreaks.com/topic/106134-solved-issue-with-as3-email-form-and-php-timeout/#findComment-544375 Share on other sites More sharing options...
simplexian Posted May 19, 2008 Author Share Posted May 19, 2008 Bump. Link to comment https://forums.phpfreaks.com/topic/106134-solved-issue-with-as3-email-form-and-php-timeout/#findComment-544515 Share on other sites More sharing options...
simplexian Posted May 19, 2008 Author Share Posted May 19, 2008 Bump. Link to comment https://forums.phpfreaks.com/topic/106134-solved-issue-with-as3-email-form-and-php-timeout/#findComment-544635 Share on other sites More sharing options...
simplexian Posted May 19, 2008 Author Share Posted May 19, 2008 Bump. Link to comment https://forums.phpfreaks.com/topic/106134-solved-issue-with-as3-email-form-and-php-timeout/#findComment-544793 Share on other sites More sharing options...
BlueSkyIS Posted May 19, 2008 Share Posted May 19, 2008 have you tested your php without the flash front end? Link to comment https://forums.phpfreaks.com/topic/106134-solved-issue-with-as3-email-form-and-php-timeout/#findComment-544816 Share on other sites More sharing options...
simplexian Posted May 19, 2008 Author Share Posted May 19, 2008 Additionally... to ensure it isn't the fault of flash, I made an html file to send the email, and exactly the same problem. 10-15 minutes to recieve email. Yes. Link to comment https://forums.phpfreaks.com/topic/106134-solved-issue-with-as3-email-form-and-php-timeout/#findComment-544823 Share on other sites More sharing options...
BlueSkyIS Posted May 19, 2008 Share Posted May 19, 2008 so the script by itself runs instantly, but the email is not received for 10 minutes? or does the script by itself run for a long time before timing out? Link to comment https://forums.phpfreaks.com/topic/106134-solved-issue-with-as3-email-form-and-php-timeout/#findComment-544826 Share on other sites More sharing options...
simplexian Posted May 19, 2008 Author Share Posted May 19, 2008 The script runs instantly as far as I can tell, the 'response=success' is outputted and recognized by flash on every instance. Still, the browser hangs at "Transferring data from mydomain.com". Link to comment https://forums.phpfreaks.com/topic/106134-solved-issue-with-as3-email-form-and-php-timeout/#findComment-544829 Share on other sites More sharing options...
simplexian Posted May 19, 2008 Author Share Posted May 19, 2008 I'm sorry, 'response=passed', rather. Link to comment https://forums.phpfreaks.com/topic/106134-solved-issue-with-as3-email-form-and-php-timeout/#findComment-544851 Share on other sites More sharing options...
simplexian Posted May 19, 2008 Author Share Posted May 19, 2008 Bump. Link to comment https://forums.phpfreaks.com/topic/106134-solved-issue-with-as3-email-form-and-php-timeout/#findComment-545303 Share on other sites More sharing options...
simplexian Posted May 20, 2008 Author Share Posted May 20, 2008 Bump. Link to comment https://forums.phpfreaks.com/topic/106134-solved-issue-with-as3-email-form-and-php-timeout/#findComment-545437 Share on other sites More sharing options...
The Little Guy Posted May 20, 2008 Share Posted May 20, 2008 if the email is almost instant when you use a html based mail form, and not when you use the flash, then there is an error or problem with your action script, and not your php. Link to comment https://forums.phpfreaks.com/topic/106134-solved-issue-with-as3-email-form-and-php-timeout/#findComment-545452 Share on other sites More sharing options...
simplexian Posted May 20, 2008 Author Share Posted May 20, 2008 - Link to comment https://forums.phpfreaks.com/topic/106134-solved-issue-with-as3-email-form-and-php-timeout/#findComment-545458 Share on other sites More sharing options...
simplexian Posted May 20, 2008 Author Share Posted May 20, 2008 To test to make sure my mail server wasn't backed up in the queue, I had a friend send numerous emails before, during, and after the email sent by the contact form. All emails sent by the friend were recieved almost instantly, while the email from the contact form isn't recieved until the timeout on the PHP file. I wasn't clear. The emails that were recieved instantly were not sent through the PHP file in question, they were sent through his mail provider. Additionally... to ensure it isn't the fault of flash, I made an html file to send the email, and exactly the same problem. 10-15 minutes to recieve email. Again, an email sent by either the html mail form or flash are not recieved until the timeout on the PHP file. Link to comment https://forums.phpfreaks.com/topic/106134-solved-issue-with-as3-email-form-and-php-timeout/#findComment-545460 Share on other sites More sharing options...
The Little Guy Posted May 20, 2008 Share Posted May 20, 2008 then the only solution, is that your host, or your mail server (if your hosting on your own server) has a cron job, that checks every 10 minutes or so for new mail to be sent, then sends out the emails. If you have sent mail out before, using the same mail server, has it been sent instantly before? Link to comment https://forums.phpfreaks.com/topic/106134-solved-issue-with-as3-email-form-and-php-timeout/#findComment-545463 Share on other sites More sharing options...
simplexian Posted May 20, 2008 Author Share Posted May 20, 2008 If that is the case, is the "Transfering data from..." hanging in the browser unrelated to the delayed mail problem? If so, what is causing this hanging in the browser? I assumed they were a linked issue. Link to comment https://forums.phpfreaks.com/topic/106134-solved-issue-with-as3-email-form-and-php-timeout/#findComment-545466 Share on other sites More sharing options...
The Little Guy Posted May 20, 2008 Share Posted May 20, 2008 is there a loop of some sort in the code? you could also use the php function: http://php.net/set_time_limit Link to comment https://forums.phpfreaks.com/topic/106134-solved-issue-with-as3-email-form-and-php-timeout/#findComment-545469 Share on other sites More sharing options...
simplexian Posted May 20, 2008 Author Share Posted May 20, 2008 In what code? The PHP? <?php $name=$_POST['name']; $email=$_POST['email']; $message=$_POST['message']; $subject = 'Subject example'; $toaddress='[email protected]'; $name=trim($name); $email=trim($email); $subject=stripslashes($subject); $message=stripslashes($message); if(mail($toaddress,$subject,$message,'From: '.$name.' <'.$email.'>')){ echo 'response=passed'; } else { echo 'response=failed'; } ?> No loop present. And far as with set_time_limit, how do I implement that with the preceding code? I know nothing of PHP, obviously. Link to comment https://forums.phpfreaks.com/topic/106134-solved-issue-with-as3-email-form-and-php-timeout/#findComment-545473 Share on other sites More sharing options...
The Little Guy Posted May 20, 2008 Share Posted May 20, 2008 set time limit may not be the problem, but it shouldn't hang forever. set_time_limit(10); $name=$_POST['name']; $email=$_POST['email']; $message=$_POST['message']; $subject = 'Subject example'; $toaddress='[email protected]'; $name=trim($name); $email=trim($email); $subject=stripslashes($subject); $message=stripslashes($message); if(mail($toaddress,$subject,$message,'From: '.$name.' <'.$email.'>')){ echo 'response=passed'; } else { echo 'response=failed'; } Link to comment https://forums.phpfreaks.com/topic/106134-solved-issue-with-as3-email-form-and-php-timeout/#findComment-545477 Share on other sites More sharing options...
simplexian Posted May 20, 2008 Author Share Posted May 20, 2008 Added set_time_limit(10); as you indicated, it still hangs at "Transfering data from...". Link to comment https://forums.phpfreaks.com/topic/106134-solved-issue-with-as3-email-form-and-php-timeout/#findComment-545484 Share on other sites More sharing options...
simplexian Posted May 20, 2008 Author Share Posted May 20, 2008 And, it appears that emails are taking the same time to be recieved, despite the set_time_limit();. Link to comment https://forums.phpfreaks.com/topic/106134-solved-issue-with-as3-email-form-and-php-timeout/#findComment-545488 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.