darga333 Posted May 4, 2006 Share Posted May 4, 2006 is there a more efficient way to mail thousands of members than mail() ???every time i want to email 5000 people it takes several minutes.. or better yet, is there a way to run the mail function in the background? so people can continue doing other stuff so they dont have to wait for the script to finish???for instance.. when you submit a button.. it sends 6000 emails... well can we make it run in the background.. and then i can submit that button again.. and it will send 6000 more emails but something different ofcourseplease help !! :)also i noticed that whenever you run the mail() function... it tends to bog down the entire serverdoes anyone know anything about this and the best methods to send email? Quote Link to comment https://forums.phpfreaks.com/topic/9040-sending-email-with-php/ Share on other sites More sharing options...
ober Posted May 4, 2006 Share Posted May 4, 2006 There are more powerful engines for sending mass emails. I suggest looking into something like the Pear engine or Curl. Using mail() with that many emails is going to bog down your server and will hang the script until the process completes. You could also consider doing batches of emails instead of doing them all at once. Quote Link to comment https://forums.phpfreaks.com/topic/9040-sending-email-with-php/#findComment-33295 Share on other sites More sharing options...
darga333 Posted May 4, 2006 Author Share Posted May 4, 2006 Thank you ober! I appologize for the other email. It is just a very frustrating topic to someone that is new to php.I would have no idea how to use a Pear engine or a Curl. but I guess it wouldnt help to look it up.Thanks again! [!--quoteo(post=371246:date=May 4 2006, 09:24 AM:name=ober)--][div class=\'quotetop\']QUOTE(ober @ May 4 2006, 09:24 AM) [snapback]371246[/snapback][/div][div class=\'quotemain\'][!--quotec--]There are more powerful engines for sending mass emails. I suggest looking into something like the Pear engine or Curl. Using mail() with that many emails is going to bog down your server and will hang the script until the process completes. You could also consider doing batches of emails instead of doing them all at once.[/quote] Quote Link to comment https://forums.phpfreaks.com/topic/9040-sending-email-with-php/#findComment-33376 Share on other sites More sharing options...
flagman5 Posted May 12, 2006 Share Posted May 12, 2006 [!--quoteo(post=371246:date=May 4 2006, 06:24 AM:name=ober)--][div class=\'quotetop\']QUOTE(ober @ May 4 2006, 06:24 AM) [snapback]371246[/snapback][/div][div class=\'quotemain\'][!--quotec--]There are more powerful engines for sending mass emails. I suggest looking into something like the Pear engine or Curl. Using mail() with that many emails is going to bog down your server and will hang the script until the process completes. You could also consider doing batches of emails instead of doing them all at once.[/quote]can you please elaborate on the doing batches of email instead doing them all at once? how would i go about doing that? also i have read on other websites about using sleep() to delay the message, but using that still hangs the script right? the user cannot re-use the form until the that script is completed?i have also read about connection directly to the SMTP server.....but i am not familiar as i am n00b in all of this, if u can elborate also that would be fantasticThanks!! [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /] Quote Link to comment https://forums.phpfreaks.com/topic/9040-sending-email-with-php/#findComment-35316 Share on other sites More sharing options...
ryanlwh Posted May 12, 2006 Share Posted May 12, 2006 there's a way to submit a script to the background. there's a tutorial on php freaks about forking that has a brief explaination of how to do that. you'd need the privilege to use system() and run certain server commands. another alternative is to have a script that is cronned/scheduled to pick up new messages that are submitted to the database and send them. still, i think pear or curl should be the better alternatives. Quote Link to comment https://forums.phpfreaks.com/topic/9040-sending-email-with-php/#findComment-35334 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.