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='xxxxxxxx@xxx.com'; $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'; } ?> Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
simplexian Posted May 19, 2008 Author Share Posted May 19, 2008 Bump. Quote Link to comment Share on other sites More sharing options...
simplexian Posted May 19, 2008 Author Share Posted May 19, 2008 Bump. Quote Link to comment Share on other sites More sharing options...
simplexian Posted May 19, 2008 Author Share Posted May 19, 2008 Bump. Quote Link to comment 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? Quote Link to comment 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. Quote Link to comment 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? Quote Link to comment 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". Quote Link to comment Share on other sites More sharing options...
simplexian Posted May 19, 2008 Author Share Posted May 19, 2008 I'm sorry, 'response=passed', rather. Quote Link to comment Share on other sites More sharing options...
simplexian Posted May 19, 2008 Author Share Posted May 19, 2008 Bump. Quote Link to comment Share on other sites More sharing options...
simplexian Posted May 20, 2008 Author Share Posted May 20, 2008 Bump. Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
simplexian Posted May 20, 2008 Author Share Posted May 20, 2008 - Quote Link to comment 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. Quote Link to comment 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? Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment 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='xxxxxxxx@xxx.com'; $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. Quote Link to comment 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='xxxxxxxx@xxx.com'; $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'; } Quote Link to comment 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...". Quote Link to comment 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();. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.