air
air

Reputation: 6264

Maximum execution time of 30 seconds exceeded swift mailer

I am using swift mailer using this statement:

  require_once 'lib/swift_required.php';

to send email.

It was working fine for many months and now suddenly I start getting this error:

Fatal error: Maximum execution time of 30 seconds exceeded in
 ...\lib\classes\Swift\Transport\StreamBuffer.php on line 271

I don't know why this error suddenly comes up and no emails are being sent. I have done nothing, it just stop suddenly. Also I own the server and I have made no changes to this server.

Actually the file called to send email is by jquery and I see in firebug that it calls the file properly but when it calls the file to send email, it gives this error after some time.

Thanks

Upvotes: 3

Views: 6260

Answers (1)

Patrick at CloudBudgie
Patrick at CloudBudgie

Reputation: 785

If you are certain that nothing else has changed, is it possible it now takes longer then 30 seconds to send the email? The 30 second maximum can be adjusted in PHP, either globally in php.ini or per request. While generally not recommended to increase this in a production environment, typically it is ok for back end jobs like sending mails out.

You can change it by doing: ini_set('max_execution_time', 600);

Set to 0 for infinite time, although if you have a real problem on the server, your request may not ever complete.

Upvotes: 3

Related Questions