Add logging of undefined exceptions
Add logging of successfully sent emails