Then you would send the file like this (where the lyrics file contains your subject line and text): $ sendmail recip < lyrics I would just like to say that, in my opinion, longer hair and other flamboyantĪffectations of appearance are nothing more. However, when using this approach, you would add your subject line to the file you intend to send as in this example file: You can also use sendmail on the command line to send a message complete with a subject line. You can send just a subject line (with no message content) with a command like this: $ echo "Subject: leaving now" | sendmail recip Using sendmail, you can send a quick message (with no subject) using a command like this (replacing "recip" with your intended recipient: $ echo "leaving now" | sendmail recip In both cases, the -s options allows you to provide a subject line for your message. You could use a command like this one: $ echo "Reminder: Leaving at 4 PM today" | mail -s "early departure" mybossĪnother option is to grab your message text from a file that contains the content you want to send: $ mail -s "Reminder:Leaving early" myboss < reason4leaving Maybe you need to remind your boss that you're leaving a little early that day.
The easiest way to send a simple message from the Linux command line is to use the mail command. Here's a look at some of the options: mail The choice depends on what you want to do -– whether you want to get a quick message off to a co-worker or send a more complicated message with an attachment to a large group of people. Some are very simple and others more complicated, but offer some very useful features. There are several ways to send email from the Linux command line.