Added mail sending on exceptions