RED-TEST 0018: add support to send email when exception occurs.