Hi,
You need a properly configured mail server for 'mail' command to work.
You can configure postfix on your system.
Another way to do this is that when a process stops, then a script can log into a remote server which has a configured mailserver. Like for CSE, we have '
mars.cse.iitb.ac.in' which can be used as a mailserver.
Thanks.
Bharat