Intro to Unix

Mail

The purpose of this lesson is to introduce you to the options available for electronic mail and show how the Unix mail command works.

Many Options for Mail

Since the earliest days of the Internet, electronic mail has one of the most popular applications.

Today, there are hundreds and hundreds of software programs that give you the ability to send and receive mail.

You can check out your options and choose the one that is right for you.

mail

You can use the Unix mail program to send and receive messages.

You will not have mail commands on the test, so you don't have to memorize how to use mail.

If you don't want to use the Unix mail program, you are responsible for choosing your own mail program and becoming adept at using it to send and receive plain text messages.

How mail Works

You use the Unix mail command to send and receive mail.
Sending Mail

Say I want to send a short note to the person with the email address nobody@december.com. Here is an example of how I would do this:

$ mail nobody@december.com
Subject: Hi
This is just a short note to say hello.
I don't have anything else right now.
.
Cc:
$ 
In this example, I enter the first line:
$ mail nobody@december.com
Unix responded with the line starting with Subject:. I typed in the text Hi and hit the Enter key. Then I typed in the first sentence and hit the Enter key. Then I typed in the second sentence and hit the enter key. Since I was done with the email message, I typed a period (.) in the first column. This period in the first column told the mail program that I was done.

The mail program then prompted me with Cc: to ask me to put in anyone else's email address whom will get copies of this message. There were none, so I pressed Enter. This ended my mail session, and so I am back to the shell prompt.

This example showed how I used a mail session to enter the contents of a message. I could have prepared a file containing the contents of the message and then used this one-line mail trick to send the message.

Receiving Mail

To check to see if I have any incoming messages, I simply type mail and hit Enter at the shell prompt:

$ mail
No mail.
$

I guess I don't have any messages, because Unix has told me so. I'll wait a bit and try again. Later on, I did get mail, as in this mail demo. Check out this mail reference for more mail commands.

Unix alternatives to mail

  • pine
  • elm

Web-based mail

A good option for mail is Web-based mail. You can get your mail using a Web browser from any Internet-connected computer.

In Web-based mail, you would use cut-and-paste methods of transferring text from your Unix windows to your mail program.

Exercise: Find your favorite mail program

Experiment with a couple of the mail programs available. Try sending yourself email, receiving it, and replying to it.

Save this page to any social bookmarking site! Share · Search · Market · Directory
2015-11-01 · John December · Contact · Terms of Use © December Communications, Inc.