I have pl/sql procedure that is using java mail package. I call my procedure and pass two arguments from my form 6i. I want to catch an exception whenever the smtp server is down. Normally, thats the message I get when it's unable to find the Smtp Sever.

SQL> exec email.dropcalls(1,'test');
javax.mail.MessagingException: Could not connect to SMTP host:, port: 25;
nested exception
java.net.ConnectException: Connection refused
java.net.ConnectException: Connection refused

PL/SQL procedure successfully completed.

If someone has a clue, please help me! Thanks.