luciogodoy Posted November 26, 2007 Share Posted November 26, 2007 Hi All; I have created a registration page for my site, and once the information provided is validated OK, the script inserts all the data on to MYSQL and after that it sends a Welcome Email to the user. My problem is that the user has to wait sometimes few minutes, with the form on front of then while the script is sending the mail. My questions are: 1) Is there a way to "pipe/delegate" the email job to another script while freeing the form web page, as in the Process Flow: Form Completed ------(3 seconds)----> New page "welcome to the Club" --( fork another script)---(1 to 4 minutes)----> Send Welcome email to the user 2) While the email is being sent, the form page refreshed to a "Waiting Bar.GIF" and when the email is sent it refreshed to a new page like: "welcome Html Page"? My prefered method woul dbe number 1! Thank you Lucio Quote Link to comment Share on other sites More sharing options...
Sulman Posted November 26, 2007 Share Posted November 26, 2007 It might be worth looking at your mail script. 1-4 mins is far to long to send one email. Can you post the code. Quote Link to comment Share on other sites More sharing options...
luciogodoy Posted November 26, 2007 Author Share Posted November 26, 2007 Here we go: ------>>>>>>>>>>> $from = 'webmaster@xxx.com'; $subject = "New Account Activation"; $headers = 'From: support@xxx.com' . "\r\n"; $template = "account_activation/welcome_to_xxx.txt"; $FileHandle = fopen($template, 'r') or die("can't open file template"); $contents = fread($FileHandle, filesize($template)); fclose($FileHandle); $message = str_replace("RANDON_FILE_NAME", $randon_file_name . ".php", $contents); mail($primary_email, $subject, $message, $headers); <<<<<<<<<<<<<<------------------------------------------- That is it !! Thanks Lucio 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.