Unix E-Mail Quick Reference
About Unix E-Mail
=================
When you login to your system you may see a message such as "You have
mail". This means that someone has sent electronic mail to you. Unix
stores mail messages deep in its file system (often in /usr/spool/mail)
for a recipient until that person logs in and reads them.
Unix systems offer many mail handling programs; this document describes
the most common program, mailx. Note that all commands discussed here
require you to press Enter to perform them.
Sending mail
============
To send mail, supply the addresses of the persons you want to receive the
mail message:
$ mailx auser thatuser@foo.bar.edu
The first address above is a person on the same computer as yours; the
second denotes a person on the Internet ("thatuser" is his username, and
"foo.bar.edu" is his Internet computer domain name). If you want to keep
a copy of the message, add your username to the list of recipients. Here
is a sample mailx session:
$ mailx auser thatuser@foo.bar.edu myusername
Subject: Budget status
Whenever it is convenient, I need to know the
status of the latest budget revisions. Thanks!
^d
$
While typing the message, remember to press Enter after every line. Type
"^d" (press and hold Ctrl, then press d) to end message input and send
it; you are then returned to the shell. If you decide not to send a
message while entering it, type "~q" at the start of a message line (the
message is placed in a file called dead.letter in your account).
Reading mail
============
When you see the message "You have mail", type mailx to read it. Mailx
displays a list of the items it has for you to read, whether each message
is new (N) or unread (U), a message number, the sender, when it was sent,
and the subject of the message. The current message is marked with ">".
You read a message by entering its number at the mailx command prompt
(?); delete a message by typing "d" at the mail prompt after reading it.
Undeleted messages are appended to the file mbox in your account after
you read them. To exit mail reading, type "q" at the mailx prompt.
What follows is a sample mail reading session:
$ mailx
Mail version 4.0 Tues Nov 15 1994 Type ? for help.
"/usr/spool/mail/myusername": 2 messages 1 new
>U 1 auser Mon Nov 14 10:05 19/11 Meeting
N 2 him@foo.bar Mon Nov 14 11:10 14/22 Hiya!
? 2
Message: 2
Date: Mon, 14 Nov 1994 11:10 EST
From: him@foo.bar (John Smith)
To: myusername@baz.faz.edu
Subject: Hiya!
Just thought I'd try my new e-mail account!
? d
? q
$
Other mail reading commands include n (display the next message), p
(redisplay the current message), r (reply to the sender of the current
message), R (reply to the sender and all other recipients), h (display a
summary of the messages) and x (exit mail without deleting any messages).
Help facilities
===============
Help while sending mail is available by typing "~?" and at the start of a
message line. To redisplay your message type "~p" at the start of a line.
Help while reading mail is available by typing "?" at the mail reading
prompt (?).
Online tutorials
================
Online tutorials may exist on your Unix system; Sun workstations offer
info pages. See your local system administrator or local documentation
for further information.
Related topics
==============
See other Unix Quick Reference documents for other topics.
|