add logging for sending mails