Command line mail message with postfix in (K)ubuntu

Problem

You have installed postfix in your local development machine (sudo apt-get install postfix), and you want to test sending emails from the command line using mail email_address@someone.com

 

Solution

You would first need to install the mailutils package:

sudo apt-get install mailutils

then you can send an email by:

mail email_name@example.com
CC: (leave blank)
Subject: Test subject
Main message body

and you can send it by pressing Ctrl+D