added logging for emails.