Once the SMTP is configured go to TFS Admin and select Alerts.
VSTS provides various types of alerts like check-in alerts, build alerts, code review alerts, etc.
For the purpose of the demo, I am creating a build fail alert. Select “Build alerts”, then select “A build fails” template. A build Fails window will open, enter the list of email ids to which mail has to be sent and click “Save and close” button.
Now, whenever a build fails all the recipients will receive a build fail email, as shown below.
Similarly, we can create alerts for check-in, build, code reviews, work items, etc.