I use SwiftMailer to send emails from a gearman worker process. I'm using the Swift_SmtpTransport
class to send emails.
The problem is that if this worker process stays idle for sometime, the SwiftMailer smtp connection times out. Now when the next job arrives, SwiftMailer fails to send emails as the connection has been timed out.
Ideally, I would want to close the smtp connection after every job. I'm unable to locate a api in the class which does this specifically. Neither does unset()
object works since this is a static class.