Video:How to Use the Mail Command in Linuxwith Zoya Popova
Learning how to use mail command in Linux is an easier process than you may think. Watch this video from About.com to see instructions for doing it.See Transcript
Transcript:How to Use the Mail Command in Linux
Hi, I'm Zoya Popova for About.com, and today I'm going to show you how to use the mail command in Linux.
Sending and Receiving Mail in Linux
Mail is used to send and receive messages in your Linux terminal. Using this command successfully involves a lot of tweaking of your system. For starters, you should check if you have all the appropriate software to run the mail command.
Software for Linux
When I enter "mail" for the first time, the terminal will recommend the software that must be installed in order to use the mail command. We will install the mailutils package:
sudo apt-get install mailutils
Basic Mail Command Steps in Linux
A lot of further configuring is required to successfully send and receive mail, but that is a technically challenging tasks. So I'll just take you over the basic steps of using the mail command.
To send a message, type "mail". To introduce the subject of a message, enter the option "-s", followed by the subject in quotation marks. At the end of the command line, specify the recipient of the message.
mail -s "Test Message 1" firstname.lastname@example.org
Entering the Recipient in Mail Command in Linux
After you hit enter, the terminal will take you through a series of interactive steps. First, it will ask you to enter the recipient of the copy of this message:
To ignore this, simply hit "Enter". The next empty line is a prompt for you to enter the message body. Once you're done, hit enter, and at the next empty line, hit Control+D.
This should send out your message.
And this is how you use the mail command in Linux. Thank you for watching, and for more information please visit us at About.com.