Forum Moderators: coopster

Message Too Old, No Replies

Sending emails

Why does my session expire?

         

ketlane

8:02 am on May 14, 2005 (gmt 0)

10+ Year Member



Hi!
My Hosting Service only allows me to send 250 emails/hour so I send an email every 15 seconds when sending a newsletter. I use a cron job to start the script at 9am and it should keep this script running until it finishes 10 000 emails (newsletter subscribers). After sending each email I log this in a MySQL db. And in my monitor I see that it stops after sending a various number of emails: 100, 400, 1000, 2300 or whatever(it never send all the 10000 emails). I have set up the maximum execution time variable to 0. Still, I have no idea: why does my emailing script stop? I've watched it myself a couple of times. It shows me no error. The browser just stops from loading after sending a number of emails. (error_reporting is set to 53 - no notices - notices shouldn't stop the script)
Also, I have set the abort_user_ignore variable to true.

I ran out of ideas. Could anyone give me a hint?

jatar_k

3:25 pm on May 14, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



so it sleeps between sends?

A better method would be to execute it via cron every 5 mins and have it send 20 emails, then mark them somehow in your db as sent. Next execution it then selects the next 20 that are unsent and sends them and marks them sent in the db and then continue.

You can have it send you an email when there are no more rows to send and then you can turn off the cron.