How to send mail from the Linux Command line (or shell script) using the mail command.
echo "This is the body of the email" | mail -s "Email Subject" email@example.com -- -f firstname.lastname@example.org
The -- -f section is used to plug in a sender address, otherwise the mail will be sent from your root or user account from the actual physical server name - e.g email@example.com
This comes in handy for notification of script execution, for example, jobs in the crontab. Placing this code immediately after the last command in a shell script will ensure relevant person(s) are notified when the script is called.