Install sendmail

apt-get install sendmail

To verify: ps -aux | grep sendmail

Fix your hosts

Verify your hostname: hostname

Edit your hosts file: nano /etc/hosts

Adjust this line similarly: yourhostname localhost.localdomain localhost

Configure sendmail

Modify your config file and add your domain.

sudo nano /etc/mail/

and add these two lines at the bottom (replace with your domain name):

define(`MAIL_HUB', `')dnl
define(`LOCAL_RELAY', `')dnl

Run sendmail config and choose Y when prompted.

Restart sendmail with: service sendmail restart

Test your setup

echo -e "To:\nSubject: Test\nTest\n" | sendmail -bm -t -v