Refactored Email Error to email logs