How to send email from the Linux command line

How to send email from the Linux command line

There are several ways to send email from the Linux command line. Some are very simple and others more complicated, but offer some very useful features. 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. Here’s a look at some of the options:


The easiest way to send a simple message from the Linux command line is to use the mail command. Maybe you need to remind your boss that you’re leaving a little early that day. You could use a command like this one:

$ echo "Reminder: Leaving at 4 PM today" | mail -s "early departure" myboss

Another option is to grab your message text from a file that contains the content you want to send:

To read this article in full, please click here

div#stuning-header .dfd-stuning-header-bg-container {background-image: url(;background-size: initial;background-position: top center;background-attachment: initial;background-repeat: no-repeat;}#stuning-header {min-height: 650px;}