MDL-40051 core_lib: replaced add_to_log call when failing to send email with an event