"Failure is simply the opportunity to begin again, this time more intelligently."
|-- Henry Ford
However, it is extremely vital to be aware of failure or at least to know when things fail so we can fix them and get rid of issues.
Notifications are always helpful in case of failures. Consider a scenario where a build failure or test case failure has to be notified to a specific set of stakeholders. In such a situation, it is desirable to have e-mail notifications.
We will use G-mail configuration for setting up e-mail notifications. Follow these steps:
Go to https://www.google.com/settings/u/1/security/lesssecureapps and click on Turn on Access for less secure apps, as shown here, to send e-mail notifications from Jenkins 2:
Do the following from the Jenkins dashboard:
Click on Manage Jenkins, and go to the Configure System section.
Go to the E-mail Notification subsection and enter the appropriate values for SMTP Server and Default user...