Hello Forum,

I just have the following problem.

After setting up a newsletter within a web-site, I recognized the following error:

I have set up an admin area where you can edit the newsletter, which will send to all users who have subscribed to it.
For this I use a mysql-database where the user data (and the email-address) is stored and the mail-function to send the emails to the users.

The email has user-specific data (like the unsubscribe hyperlink with the user's id) so I cannot us the CC: option to send the newsletter to all the users.
After pressing the submit button the php-page starts working and - because there are a lot of users in the database - stops with an time-out error message.

My question now is: How to I realise such a newsletter script to avoid a timeout while sending the emails? Are there any workarounds or other (better) solutions how to send personalized newsletter to a huge amount of subscribed users?

Thank you in advance
Karsten

    15 days later

    Hello Karsten,

    the problem is, that your webserver gets an time-out by the php module.

    A possible workaround is, that you write a "processing" page, which just sends a part of the email amount.
    e.g. first turn: just send emails to account 101 to 120. This upper end (120+1) value, you use as a posting variable when recalling the same procession-page, which then will start with 121 and so on.

    This solution avoids getting an timeout.

    HTH
    John

      Or a quick and nasty solution may be to increase the timeout from within the script, like this:

      set_time_limit(300); // increase to 5 minutes

        Write a Reply...