Jump to content

sending email with php


darga333

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?
Link to comment
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.
Link to comment
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]
Link to comment
Share on other sites

  • 2 weeks later...
[!--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\" /]
Link to comment
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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.