Jump to content


Photo

sending email with php


  • Please log in to reply
4 replies to this topic

#1 darga333

darga333
  • Members
  • PipPipPip
  • Advanced Member
  • 53 posts

Posted 04 May 2006 - 07:34 AM

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?

#2 ober

ober
  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 04 May 2006 - 01:24 PM

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.

Info: PHP Manual


#3 darga333

darga333
  • Members
  • PipPipPip
  • Advanced Member
  • 53 posts

Posted 04 May 2006 - 06:12 PM

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) View Post[/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]


#4 flagman5

flagman5
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 12 May 2006 - 10:29 PM

[!--quoteo(post=371246:date=May 4 2006, 06:24 AM:name=ober)--][div class=\'quotetop\']QUOTE(ober @ May 4 2006, 06:24 AM) View Post[/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\" /]

#5 ryanlwh

ryanlwh
  • Staff Alumni
  • Advanced Member
  • 511 posts

Posted 12 May 2006 - 11:59 PM

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.
Please use EDIT * 100...
Please use
or [php] * 1000...

PLEASE READ THE POSTED SOLUTIONS CAREFULLY * 1000000...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users