added logging for sending emails