Adds logging to sending mails