Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Massmailing without timeout

Status
Not open for further replies.

Sleidia

Technical User
Joined
May 4, 2001
Messages
1,284
Location
FR
Hello,

I've created a nice mailing list utility in PHP, but the only one problem I have is that the use of the mail() function causes timeouts when sending a large quantity of emails to my registered members.

Is there a code sample somewhere I could use so that I won't experience timeouts anymore?

Or at least, could someone tell me what should I use in replacement of the mail() function?

Is there another solution ( ie: pausing every 500 mails, etc )?

Thanks a lot for helping.
Have a nice day.

 
no matter how you do it, there is still a limit on the maximum execute time within the php.ini, you would need to change that.

max_execution_time = 30 ; Maximum execution time of each script, in seconds
 
Thanks btaber,

Unfortunately, I've already done that before and this won't be enough. I believe there are more efficient ways to send large chunks of emails.

Perhaps, using the system() functions with sendmail commands ??
 
personally, I would use perl to do this, since timeout is not an issue....
 
set_time_limit(0); solves all problems with timeouts... as long as your server supports it!

--BB
 
There are many ways to do this - some are combinations of server and client side technologies.
For example:
A php script that works through the addresses, n at a time, and keeps count with a session. The produced HTML has Javascript code (as long as more mails are to be sent) which refreshed the page.
Also, PHP as a command line interpreter has no timeout issues.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top