#file: "/media/imprint/software/projects/sookh/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php"
$transport = (new Swift_SmtpTransport($host, $port))
->setUsername($user)
->setPassword($pass);
$try {
$transport->start();
} catch (\Swift_TransportException $ex) {
echo $ex->getMessage();
return; //whatever you want to do.
}
....