avoid timeout in Swiftmailer

Asked

Viewed 40 times

0

Using swiftmailer and throttler to send emails, the problem is that the browser timeouts because the throttler pauses to keep sending within limits (5 emails per minute), I think the script keeps running, is that a problem? there is a way to avoid timeout ?

// Use AntiFlood to re-connect after 100 emails
$mailer->registerPlugin(new Swift_Plugins_AntiFloodPlugin(50));

// And specify a time in seconds to pause for (30 secs)
$mailer->registerPlugin(new Swift_Plugins_AntiFloodPlugin(50, 30));



// Rate limit to 100 emails per-minute
$mailer->registerPlugin(new Swift_Plugins_ThrottlerPlugin(
  5, Swift_Plugins_ThrottlerPlugin::MESSAGES_PER_MINUTE
));

// Rate limit to 10MB per-minute
$mailer->registerPlugin(new Swift_Plugins_ThrottlerPlugin(
  1024 * 1024 * 10, Swift_Plugins_ThrottlerPlugin::BYTES_PER_MINUTE
  • 1

    Already check the timeout time in php.ini ? Or tried using the function set_time_limit(0); ?

  • yes I’ve tried that ! the timeout in php.ini is general and as the script takes many breaks I wouldn’t like to go there ...

  • You can set by code also with ini_set('max_execution_time', 0); making there is no limit

  • I tried but with no result. timeout anyway

  • The ini_set function, defines the value of a configuration, with it, you can change the configuration by code

  • Thanks William Herme...I tried that in the script but did timeout on the table

  • Tb increased maxexectime in Cpanel but tb gave timeout

Show 2 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.