Error notification if send mail api returns 500

closes #3728
- If the mail config is broken, the ajax call will fail with 500 and
not return an error.
- This change catches 500 and wraps the error in a notification.