My procedure loops through (each user in the database) and does a simple task of notifying users via email using UTL_SMTP.

The problem I have come across is this:

When the user is no longer with the company, then the email address that UTL_SMTP tries to send to is invalid and the procedure exits with this error:

ERROR at line 1:
ORA-29279: SMTP permanent error: 550 5.1.1 [email protected]... User unknown
ORA-06512: at "SYS.UTL_SMTP", line 17
ORA-06512: at "SYS.UTL_SMTP", line 98
ORA-06512: at "SYS.UTL_SMTP", line 240
ORA-06512: at "my.procedure", line 96
ORA-06512: at line 1

That's understandable...

My question is: How do I make my procedure "ignore" this kind of error and have it continue through the loop and finish the procedures??