Added logging into email communication