updated to log email sending