Step 1. Open up a terminal and type
sudo apt-get install sendmail
This will install the complete sendmail application. It will take a minute or so to complete.
Step 2. Open up a terminal and type
hostname
This will display your hostname.
Step 3. Open up a terminal and type
sudo gedit /etc/hosts
or whatever text editor you like using to open up your hosts file for editing.
Step 4. Modify the first line so it reads
127.0.0.1 localhost localhost.localdomain yourhostname
Restart your computer.
It will now work.