You can use sendEmail to send emails from the terminal, SendEmail is a lightweight, command line SMTP email client. If you have the need to send email from a command line, this free program is perfect: simple to use and feature rich.It was designed to be used in bash scripts, batch files, Perl programs and web sites, but is quite adaptable and will likely meet your requirements. SendEmail is written in Perl and is unique in that it requires NO MODULES.
To install sendEmail in Ubuntu:
sudo apt-get install sendEmail
Now to send email ,
sendEmail -f FROM -t TO -s SERVER -u SUBJECT -m MESSAGE
To learn more about sendEmail use the man command :