Problem with catching exceptions
Posted: Fri Feb 27, 2009 2:13 am
I have the following code for catching a connection exception:
But I still get the following error:
Code: Select all
$smtp =& new Swift_Connection_SMTP("mail.henridoorten.nl");
$smtp->setUsername("info@henridoorten.nl");
$smtp->setpassword("password");
try{
$swift =& new Swift($smtp);
}catch (Swift_ConnectionException $e) {
echo "There was a problem communicating with SMTP: " . $e->getMessage();
}
Why do I not catch the exception? What am I doing wrong?Fatal error:
Uncaught Error of type [Swift_ConnectionException] with message [Authentication failed using username 'info@henridoorten.nl' and password '********']
@0 include() in /usr/home/deb11522/domains/meubelproducten.nl/public_html/admin/show_order.php on line 4
@1 Swift::Swift() in /usr/home/deb11522/domains/meubelproducten.nl/public_html/admin/include/storingEmail.php on line 14
@2 Swift::connect() in /usr/home/deb11522/domains/meubelproducten.nl/public_html/admin/include/classes/Swiftmailer/Swift.php on line 109
@3 Swift::handshake() in /usr/home/deb11522/domains/meubelproducten.nl/public_html/admin/include/classes/Swiftmailer/Swift.php on line 230
in /usr/home/deb11522/domains/meubelproducten.nl/public_html/admin/include/classes/Swiftmailer/Swift/Errors.php on line 99