Send mail from the command line

October 22, 2015 — Leave a comment

As a Linux Admin, you’ll eventually come across the need to send an email from the server you’re working on. Here’s how to do just that.

With ‘mail’
You can use the mail program by doing this:

(type some text for the body of the message.. end with a single period (.), hit enter.. OR, just hit ctrl-d to send with no body)

With ‘mutt’ (sending an attachment…)
You can use mutt if you’d like to send an email with an attachment. In our example, we’re sending /tmp/file.tgz.

No Comments

Be the first to start the conversation.

Leave a Reply