Jump to content

Archived

This topic is now archived and is closed to further replies.

darga333

sending email with php

Recommended Posts

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 ofcourse

please help !! :)

also i noticed that whenever you run the mail() function... it tends to bog down the entire server

does anyone know anything about this and the best methods to send email?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
[!--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 fantastic

Thanks!! [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.