Updated config to send mail when there is an error.