To secure your machine, there are hundred different things you can do, but the most important thing is to know what's happening on your Machine. In that getting the alerts as soon as someone login is one of very important and must thing to do.
So, to do the same thing, you can go with two approaches:
Everyone is not as lucky as having a full fletched email client like thunderbird or kmail to send mails. There is one unlucky group known as system administrators who have to send the mails either through the command line or a script running on the remote server. Also, apart from sending the emails, sometimes one needs to test or debug the email server which can't be done by traditional email clients. If you are one of those system administrators and are scared, then you shouldn't be, because this is where netcat comes to rescue.