First install exim4 and exim4-config using the package manager
then install mailx
sudo apt-get install mailx
sudo dpkg-reconfigure exim4-config
and follow the prompts
once this is set up use the command “mail” to check your mail.
if you would like to send mail type “mail” followed by the email address to mail it to eg
enter the subject and press <enter>
enter the body and keep pressing enter as many times as you need to, when your body is finished, press “Ctrl” and “d” together this will prompt you for a cc etc and finally the mail will be sent.
Remember that if your domain name is not qualified eg (machine is not a web site with a domain name) this will not work. I can only get this to work on servers that are hosting content and have a qualified domain name, if anyone knows how to get this to work on a home pc without a qualified DNS name please let me know.