I work a lot with application servers and virtual machines. While these are not mail servers they do need to be able to send out email for various reasons.
This post demonstrates how to install Postfix and Mailutils on Ubuntu.
Installing postfix is quite easy.
Following along with the install wizard and keeping the defaults is generally fine.
Following postfix I install mailutils
With mailutils you can send out mail from the commandline with ease:
If you have trouble sending mail (perhaps you had another mail agent installed), then doing a reinstall might fix the problem.