When using SwiftMailer’s Swift_SmtpTransport there is a timeout setting.
https://symfony.com/doc/current/reference/configuration/swiftmailer.html#timeout
What does this refer to? Is it just the timeout used to login to the server or is it for the complete operation of logging in and sending the message(s)?
I came across this because I noted if you use invalid SMTP credentials it takes 30 seconds before the script continues — which is far too long for a public website. Using setTimeout(5) seems to be much more acceptable in the case of invalid credentials (e.g. they get changed) or the server being down.
If this is just to login to the SMTP server I think 5 seconds is more than adequate. If this is to send messages as well I still think this would be okay for sending a small number of emails. I have done a few test emails and seems fine so far but wanted to check this before going live with it.