I recently updated PHP version on our server to 8.1.11, and SwiftMailer stops working. Specifically, this function causes a HTTP 500 error on the page:
$transport = Swift_SmtpTransport::newInstance("smtp.gmail.com", 465, "ssl")
-> setUsername($row["email"])
-> setPassword($row["password"])
;
There's no reason to believe the server or email details are incorrect. It's something to do with the function call itself. A Swift Mailer help article directed me here.
Anyone know what I need to do?