2

everyone

Background: I am using phpmailer to send emails. For a group of users to register into our system. So the admin person click register, all the emails(100+) should be sent to their email boxes.

Problem: The admin can not wait a long long time just for the system respond. Also, the system will report timeout after 30 seconds.

Now, only the first 6 or 7 emails are sent successfully. Other emails will be failed to be sent because of timeout.

Question: So, how to fix this problem?

Many thx.

huawei chen
  • 328
  • 4
  • 9
  • 1
    Easiest solution is to save the emails in some location (specially formatted file or a database), and then have a script periodically check said repository for any pending emails and then send them. – Corbin May 08 '12 at 01:01

1 Answers1

1

You can use set_time_limit To increase the time the script is allowed to run, also check out How do i implement this scenario using PHP?

Community
  • 1
  • 1
Musa
  • 96,336
  • 17
  • 118
  • 137