You can catch that exception and handle it:
try {
$transport = Swift_SmtpTransport::newInstance(self::$host, 25)
->setUsername(self::$username)
->setPassword(self::$password);
//Create the Mailer using your created Transport
$mailer = Swift_Mailer::newInstance($transport);
$message = Swift_Message::newInstance("Custom Sheets");
$message->setFrom(array('EDB@abc.com.pk' => 'Approval of Custom Duty Sheet'));
$message->setTo($to);
$message->setBody($html,'text/html');
//Send the message
$result = $mailer->send($message);
} catch(Exception $e) {
// handle error here
}
Turning off errors / warnings / notices in general:
error_reporting(-1);