Published January 13, 2018 by

mail: command not found in Linux & Working with 'mail' command

In Linux mail command is used for sending mail from your Linux server/machine.

Install 'mail' command

For CentOS/Redhat
 yum install mailx  
For Ubuntu/Debian
 sudo apt-get install mailutils
For Fedora
 dnf install mailx
Sending Mail

1. Send Full Mail using the following command:
 mail -s "Hello World"
OR you can also send mail to multiple recipients:
 mail -s "Hello World",
it asks for cc: and mail body
 # mail -s "Hello World"  
 Hi Subhash  
 How are you  
 This is Test Mail  
Press Ctrl+D for send mail

2. Mail in a Single Line
 mail -s "subject" <<< 'mail body'