37

I want to send hundreds of emails using PHP. To increase the execution time, I used ini_set('max_execution_time', 10); but after sending just 30 emails the browser shows me a blank page and does not send all of the emails.

I also changed the limit to 300, 600 ..

1
  • 2
    Watch out for web server timeout, 'cos I'm guessing you're running this via a web request; and this type of task should really be executed CLI via a cron task Commented Feb 28, 2011 at 15:54

1 Answer 1

44

Try set_time_limit(0); at the top of your script.

set_time_limit sets the maximum execution time in seconds. If set to zero, no time limit is imposed (see PHP manual).

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, glad that i know i should place it on first invoked script. Not the second one. Kindly explain why it have to be the first?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.