The purpose of this lesson is to introduce you to the options available for electronic mail and show how the Unix mail command works.
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.
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.
Say I want to send a short note to the person with the email address firstname.lastname@example.org. Here is an example of how I would do this:
In this example, I enter the first line:$ mail email@example.com Subject: Hi This is just a short note to say hello. I don't have anything else right now. . Cc: $
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.$ mail firstname.lastname@example.org
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.
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.
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.
Experiment with a couple of the mail programs available. Try sending yourself email, receiving it, and replying to it.