Add exception handling for email alerts