Adds better logging of sending emails