home *** CD-ROM | disk | FTP | other *** search
- Compiled by OARnet
- Last change Thu Mar 11 14:49:12 EST 1993
-
- This introduction assumes you are sending mail using the UNIX mail
- command in /usr/ucb/mail. To find out which mail command you are using,
- type
-
- which mail
-
-
- A. How to Send Electronic Mail From Your UNIX Account
-
- To send electronic mail from your UNIX account, you will need to know
- the address of the person to whom you are sending. Often, the mail
- address will be of the form user@site.domain or user@host.site.subdomain.
- The easiest way to find someone's address is to ask them. Directories
- of electronic mail addresses are under construction at universities and
- companies across the world; however, right now the development is
- decentralized and incomplete.
-
- Suppose you want to send a message to a person who has given you the
- e-mail address nis@oar.net. At your normal UNIX prompt, type:
-
- mail nis@oar.net
-
- The machine will prompt you for a subject. Type in a subject and press
- Return.
-
- Subject: First Electronic Mail Message
-
- Then, just start typing the contents of your mail message, which might
- look like this:
-
- This is my first electronic mail message. Please respond
- to let me know it reached you all right.
-
- Wilma Stephens
-
- To end the message, just type a period on a line by itself:
-
- .
-
- You should see your regular system prompt again, represented by "$"
- below. The session in which you sent the above message
- would have looked something like this:
-
- $ mail nis@oar.net
- Subject: First Electronic Mail Message
- This is my first electronic mail message. Please respond
- to let me know it reached you all right.
-
- Wilma Stephens
- .
- $
-
- If you are composing a message and you want to stop and cancel the
- message, type Control-c twice. To do this, hold down the Control
- key and press "c", and repeat. (See below for information on recovering
- and editing an aborted mail message.)
-
- To practice sending and receiving mail, you can send some mail to
- A Short Electronic Mail Primer
- yourself and then read it. You can send mail to several people by
- including several addresses after the command "mail" when you begin
- to draft your message.
-
-
- B. How to Read Mail on UNIX
-
- The system will tell you if you have mail when you log in. To read
- your electronic mail, type
-
- mail
-
- If you have received any electronic mail and your system uses the
- default BSD UNIX mail, you will
- see a bunch of abbreviated mail headers and a "&" prompt:
-
- N 1 kris@osc.edu Fri Mar 5 14:58 36/1519 Dave Knight
- N 2 danw@oar.net Fri Mar 5 15:06 49/1255 nhc gopher
- N 3 henryc@oar.net Fri Mar 5 15:17 56/1940 Re: please send
- &
-
- The "N" stands for new and the numbers reflect the order the messages
- came in; the address, in the form user@site.domain or
- user@host.site.domain (or worse), is an e-mail address for the person
- who sent the mail. Next comes the date and time the message was
- received, the size in lines and in bytes, and the subject that the
- sender specified.
-
- To start reading the messages, just press the Return key at the "&"
- prompt. If the message is more than one screen long, a reverse-video
- line that says "--More--" will appear at the bottom of each screen. To
- scroll to the next screen of text, press the space bar. Keep pressing
- the space bar for each screen of text until you see the "&" prompt
- again. At this point you can reply to the sender by typing "r" or you
- can type mail privately to the sender by typing "m" followed by a space
- and then their address as given in the header.
-
- To get another list of headers, type "h". The "current" message will be
- preceded by ">".
-
- To show a message again, type in its sequence number (the number in the
- second column of the header). To read the next message, just press
- Return like you did the first time. To quit, type "q". All these
- commands must be followed by pressing Return (except for just Return
- alone to read the next message!).
-
- Some Commands You Can Use at the "&"
-
- m <user@host.site.dom> send mail to <user@host.site.dom>
- h show message headers
- r reply to the sender of the
- message you have just read
- R reply to the sender and anyone else
- who received the message
- q quit and save
- x quit and leave the messages as before
- you entered mail
- s <filename> save the current message in <filename>.
- Return or n show next new message
- <#> display message number #
- (e.g., "3" prints message 3)
- d delete previous message
- d <#> delete message number <#>
-
- After you have read the messages and have quit with "q" from the mail
- interface, the messages will be stored in a file called "mbox" unless
- you specify otherwise. You can set up such a specification, and a lot
- of other parameters for mail to use, in a special file that always
- stays in your home directory.
-
-
- C. More Advanced Mail Features
-
- Once you're actually writing a mail message, you can use tilde escapes to
- do special things by putting "~" and a letter at the beginning of a
- line by itself and pressing Return. Here are some common tilde escapes
- you will want to use:
-
- Commonly Used Tilde Escapes
-
-
- ~v edit in vi
- ~!<cmd> execute outside shell command
- ~m1 put mail message 1 in this letter
- ~p redraw the screen, interpolating
- copied-in text (like message 1)
- ~r <file> copy in <file>
- ~h prompt for new receivers, subject, cc
- and bcc. Allows editing of subject, etc.
- ~? this list plus some more
-
-
- Forwarding a Message
-
- Here's an example of using tilde escapes to forward a message you have
- received to another user. Suppose you have received a mail file that
- you want to forward to nis@oar.net. When you type "h" at "&" and
- get a list of headers, suppose that the mail file you want to forward
- is #1:
-
- & h
- > 1 paula@osc.edu Wed Mar 10 14:07 16/746 Mail Works!
- &
-
- You would type "m nis@oar.net", a subject for your message (at the
- "Subject:" prompt), and a brief introduction to the message.
- Then, to include the first mail file, at the start of a new line in
- your message, type "~m1". The machine replies, "Interpolating: 1", and
- tells you to continue. Your message might look like this:
-
- & m nis@oar.net
- Subject: Got Mail From Paula!
- Here is a message from Paula. She seems to be getting
- used to the e-mail system!
-
- ~m1
- Interpolating: 1
- (continue)
-
- To see the whole message with the message copied into it, at the
- beginning of the next line type
-
- ~p
-
- You might see this:
-
- -------
- Message contains:
- To: nis@oar.net
-
- Here is a message from Paula. She seems to be getting
- used to the e-mail system!
-
- >From paula@osc.edu Wed Mar 10 14:07:55 1993
- >Received: for you@oar.net
- > by dialup.oar.net (5.65c+KVa/920824.1144) id AA03676; Wed,
- 10 Mar 1993 14:07:54 -0500
- >Date: Wed, 10 Mar 1993 14:07:54 -0500
- >From: Paula Williams <paula@osc.edu>
- >Message-Id: <199303101905.AA03676@osc.edu>
- >To: you@oar.net
- >Subject: Mail Works!
- >Status: R
- >
- >This is my first mail message. It's great
- >to be networking with you!
- >
- >Paula Williams
- (continue)
-
- Then you could end the message to send it, add additional information,
- or invoke the editor, if you want. You can invoke the editor by typing
- "~v" on a new line by itself. (Notes: To exit the vi editor, type ":wq"
- from the editor. See information on using the vi editor under separate
- cover.)
-
- After you have finished composing your mail, type "." alone on
- a line, as usual, to send it.
-
-
- Sending a File by Electronic Mail
-
- To send a UNIX file that you have previously prepared by electronic
- mail, you need to include it in a message. Reading in a regular file
- stored in your directory is similar to forwarding a file. "~r <file>"
- on a line by itself, inside your mail message, will copy <file> to your
- message. You will have to type "~p" to see your message as it now appears.
- Again, you can use "~v" to edit or view the file further.
-
-
- Changing the Recipients or Subject of a Mail Message While In Progress
-
- "~h" is another useful tilde escape. It will redisplay your "To:" and
- "Subject:" lines so you can edit them, and displays "cc:" and "bcc:"
- lines so you can specify recipients (including blank carbon copies on
- the "bcc:" line). Note: if you initiated writing your message with the
- "mail -s" option, your subject will be in the ultimate message, but won't
- show when you use "~h".
-
-
- Executing UNIX Commands From Inside Mail
-
- After reading any mail file or at any time during your mail session,
- you may say the following:
-
- !command execute a UNIX command
-
- A useful application of this is "!ls", which you can use to ascertain
- the name of a file to which you want to append a message or to ascertain
- the name of a file you want to forward to another user.
-
-
- Aborting a Message in Progress
-
- If you decide you don't want to send a message while you are writing
- it, type Control-c twice. Mail will save your "killed" message in the
- outside directory as dead.letter. If you decide later you want to
- insert part of this file into a mail message you're writing, "~d" will
- copy in the contents of dead.letter. Then you can "~p" and "~v" to
- view and edit your message's new contents.
-
-
- Mail Aliases
-
- If you find yourself sending mail often to the same group of electronic
- addresses, you may want to set up a mail alias for your private use.
-
- Aliases (and customization parameters as discussed in the next section)
- that you maintain for your use reside in a special file in your home
- directory. To create an alias, edit the file .mailrc:
-
- vi .mailrc
-
- Add some aliases in the form:
-
- alias <alias_name> <addr1> <addr2> <addr3> <addr4>
-
- Substitute the name of the alias for <alias_name> and the e-mail
- addresses you want to include for the <addr> fields. Do not press Return
- between addresses; just extend the line, letting it wrap around.
-
- For example, here is an alias as it might appear in a .mailrc file.
- Note that it is one long, continuous line.
-
- alias announce xxbrent@porrima.lerc.nasa.gov zachary@pacific.mps.o
- hio-state.edu steve@aurora.com fielding@theory.tn.cornell.edu hph@
- ms.appstate.edu jlh@ms.appstate.edu
-
-
- Parameters to Modify the Way Your Mail Is Handled
-
- Parameters can be set or unset in a .mailrc file in order
- to control your mail environment.
-
- These are binary parameters set by the command "set <option>" or unset
- by "unset <option>".
-
- Binary Options to "set" or "unset"
-
- append causes any messages saved to be appended to the
- end of an existing file rather than prepended
- ask causes mail to prompt you for the subject of each
- message
- askcc causes mail to prompt for additional recipients
- after you initiate sending of a mail message with
- a period (dot) or Control-d. If you press Return,
- the previously set list remains the same.
- autoprint causes the delete (d) command to type the next
- message after deleting the current message
- dot causes mail to interpret a period alone on a line
- as the terminator of a message
- hold causes messages to be held so that headers for
- messages already read will appear the next time
- you type mail (otherwise, mail that has been read
- is stored in a file named mbox)
- metoo causes the sender to be included in the expansion
- of an alias
- nosave prevents aborted messages from being saved in
- the file dead.letter
-
- Here is an example of part of a .mailrc with some of the binary parameters
- set. Note: the UNIX system may have some of these set by default. The append,
- ask, and dot options are often set by default.
-
- set metoo
- set hold
- set askcc
-
-
- Other Mail Parameters
-
- Other mail parameters must be "set" to have a particular value using
-
- set <param>=<value>
-
- Here are some examples. The "record" parameter names a file to which
- the mail system will append a copy of each mail message that you send.
- The "indentprefix" parameter names a character or set of characters used
- as a prefix to each line of a forwarded electronic mail message. The
- example of forwarding given above uses the prefix set in the second line.
-
- set record=/home/paula/outbox
- set indentprefix='>'
- set printmail='enscript -Pps'
- set PAGER=/usr/ucb/more
- set VISUAL=/usr/ucb/vi
- set EDITOR=/usr/ucb/vi
- set crt=22
-
- For more information on individual parameters, see the man page for mail or
- consult a reference manual.
- .
-