hey guys, I am working on a script to send emails from a list of members. I need to be able to send the emails to between 100-200 people. Right now I am calling the email() function for each email but the browser ends up timing out before it goes through the list. What is best method of doing this? Thanks for the help!
This will keep it from timing out: set_time_limit(0); ignore_user_abort(true); PHP: Just put that at or near the top of your file.
Assuming your host allows you to override the time out... which most don't. Firstly, I would suggest not using the native PHP function: I would suggest the PHPMailer library. I believe it may support 'delayed sending' or something like that but if not... Secondly, I would suggest essentially sending a handful of emails then outputting some HTML to the browser which will automatically reload the page. On the next load, send the next handful and so on.
TwistMyArm, PHPMailer don't support 'delayed sending'. This is just advanced library for sending email. I think sending e-mail by loading page isn't a good idea. Try to run script using system(''); or by Cron.
Why don't you look at something like PHPList? Let you manage the list and what not and it can control on how fast it sends out emails.
I am using PHP mailer class for sending mass emails My hosting server allow me to send 300 email in an hour and 3000 per day So i am using cronjob for which is one after an hour and send email to 300 people