How do I suppress Swiftmailer errors?

I am using Swiftmailer for sending mails in my application. While everything works good, I want to be able to suppress all exceptions thrown by Swiftmailer and simply return false (for instance, running the application on localhost with my GMail SMTP settings throws a timeout fatal exception).

I have the error_reporting set to 0, and I also tried adding a try-catch block, but I have come to understand that the catch block wont really catch the exception.

How can I completely suppress all errors and just return false if something went wrong?

链接地址: http://www.djcxy.com/p/69364.html

上一篇: 我如何解决警告:在OpenCart中除零

下一篇: 我如何抑制Swiftmailer错误?