home *** CD-ROM | disk | FTP | other *** search
/ A Beginner's Guide to the Internet / INTERNET.ISO / text / email / e-mail__ < prev    next >
Encoding:
Text File  |  1995-03-11  |  12.3 KB  |  355 lines

  1. Compiled by OARnet         
  2. Last change Thu Mar 11 14:49:12 EST 1993
  3.  
  4. This introduction assumes you are sending mail using the UNIX mail 
  5. command in /usr/ucb/mail. To find out which mail command you are using, 
  6. type
  7.  
  8.     which mail
  9.  
  10.  
  11. A. How to Send Electronic Mail From Your UNIX Account
  12.  
  13. To send electronic mail from your UNIX account, you will need to know
  14. the address of the person to whom you are sending. Often, the mail
  15. address will be of the form user@site.domain or user@host.site.subdomain. 
  16. The easiest way to find someone's address is to ask them. Directories
  17. of electronic mail addresses are under construction at universities and
  18. companies across the world; however, right now the development is 
  19. decentralized and incomplete. 
  20.  
  21. Suppose you want to send a message to a person who has given you the 
  22. e-mail address nis@oar.net. At your normal UNIX prompt, type: 
  23.  
  24.     mail nis@oar.net
  25.  
  26. The machine will prompt you for a subject. Type in a subject and press
  27. Return.
  28.  
  29.     Subject: First Electronic Mail Message
  30.  
  31. Then, just start typing the contents of your mail message, which might
  32. look like this:
  33.  
  34.     This is my first electronic mail message. Please respond
  35.     to let me know it reached you all right. 
  36.  
  37.     Wilma Stephens
  38.  
  39. To end the message, just type a period on a line by itself:
  40.  
  41.     .
  42.  
  43. You should see your regular system prompt again, represented by "$" 
  44. below. The session in which you sent the above message 
  45. would have looked something like this: 
  46.  
  47.     $ mail nis@oar.net
  48.     Subject: First Electronic Mail Message
  49.     This is my first electronic mail message. Please respond 
  50.     to let me know it reached you all right.
  51.  
  52.     Wilma Stephens
  53.     .
  54.     $
  55.  
  56. If you are composing a message and you want to stop and cancel the
  57. message, type Control-c twice. To do this, hold down the Control 
  58. key and press "c", and repeat. (See below for information on recovering
  59. and editing an aborted mail message.)
  60.  
  61. To practice sending and receiving mail, you can send some mail to
  62. A Short Electronic Mail Primer
  63. yourself and then read it. You can send mail to several people by 
  64. including several addresses after the command "mail" when you begin
  65. to draft your message.
  66.  
  67.  
  68. B. How to Read Mail on UNIX
  69.  
  70. The system will tell you if you have mail when you log in. To read
  71. your electronic mail, type
  72.  
  73.     mail
  74.  
  75. If you have received any electronic mail and your system uses the 
  76. default BSD UNIX mail, you will 
  77. see a bunch of abbreviated mail headers and a "&" prompt:
  78.  
  79.   N 1 kris@osc.edu       Fri Mar  5 14:58   36/1519  Dave Knight
  80.   N 2 danw@oar.net       Fri Mar  5 15:06   49/1255  nhc gopher
  81.   N 3 henryc@oar.net     Fri Mar  5 15:17   56/1940  Re:  please send 
  82.   &
  83.  
  84. The "N" stands for new and the numbers reflect the order the messages
  85. came in; the address, in the form user@site.domain or
  86. user@host.site.domain (or worse), is an e-mail address for the person
  87. who sent the mail. Next comes the date and time the message was
  88. received, the size in lines and in bytes, and the subject that the
  89. sender specified.
  90.  
  91. To start reading the messages, just press the Return key at the "&"
  92. prompt. If the message is more than one screen long, a reverse-video
  93. line that says "--More--" will appear at the bottom of each screen. To
  94. scroll to the next screen of text, press the space bar. Keep pressing
  95. the space bar for each screen of text until you see the "&" prompt
  96. again. At this point you can reply to the sender by typing "r" or you
  97. can type mail privately to the sender by typing "m" followed by a space
  98. and then their address as given in the header.
  99.  
  100. To get another list of headers, type "h". The "current" message will be 
  101. preceded by ">".
  102.  
  103. To show a message again, type in its sequence number (the number in the
  104. second column of the header).  To read the next message, just press
  105. Return like you did the first time.  To quit, type "q". All these
  106. commands must be followed by pressing Return (except for just Return
  107. alone to read the next message!).
  108.  
  109. Some Commands You Can Use at the "&" 
  110.  
  111.     m <user@host.site.dom>    send mail to <user@host.site.dom>
  112.     h            show message headers
  113.     r            reply to the sender of the 
  114.                 message you have just read
  115.     R            reply to the sender and anyone else
  116.                 who received the message
  117.     q            quit and save 
  118.     x            quit and leave the messages as before
  119.                 you entered mail
  120.     s <filename>        save the current message in <filename>.
  121.     Return or n        show next new message
  122.     <#>             display message number #
  123.                 (e.g., "3" prints message 3)        
  124.     d            delete previous message
  125.     d <#>            delete message number <#>
  126.  
  127. After you have read the messages and have quit with "q" from the mail
  128. interface, the messages will be stored in a file called "mbox" unless
  129. you specify otherwise. You can set up such a specification, and a lot
  130. of other parameters for mail to use, in a special file that always
  131. stays in your home directory.
  132.  
  133.  
  134. C. More Advanced Mail Features
  135.  
  136. Once you're actually writing a mail message, you can use tilde escapes to
  137. do special things by putting "~" and a letter at the beginning of a
  138. line by itself and pressing Return. Here are some common tilde escapes 
  139. you will want to use: 
  140.  
  141.     Commonly Used Tilde Escapes
  142.  
  143.     
  144.     ~v        edit in vi
  145.     ~!<cmd>        execute outside shell command
  146.     ~m1        put mail message 1 in this letter
  147.     ~p        redraw the screen, interpolating
  148.             copied-in text (like message 1)
  149.     ~r <file>    copy in <file>
  150.     ~h        prompt for new receivers, subject, cc
  151.             and bcc.  Allows editing of subject, etc.
  152.     ~?        this list plus some more
  153.  
  154.  
  155. Forwarding a Message
  156.  
  157. Here's an example of using tilde escapes to forward a message you have
  158. received to another user.  Suppose you have received  a mail file that
  159. you want to forward to nis@oar.net.  When you type "h" at "&" and
  160. get a list of headers, suppose that the mail file you want to forward
  161. is #1:
  162.  
  163.     & h
  164.       > 1 paula@osc.edu    Wed Mar 10 14:07   16/746  Mail Works!
  165.     &
  166.  
  167. You would type "m nis@oar.net", a subject for your message (at the 
  168. "Subject:" prompt), and a brief introduction to the message. 
  169. Then, to include the first mail file, at the start of a new line in 
  170. your message, type "~m1". The machine replies, "Interpolating: 1", and 
  171. tells you to continue. Your message might look like this:
  172.  
  173.     & m nis@oar.net
  174.     Subject: Got Mail From Paula!
  175.     Here is a message from Paula. She seems to be getting
  176.     used to the e-mail system!
  177.  
  178.     ~m1  
  179.     Interpolating: 1
  180.     (continue)
  181.  
  182. To see the whole message with the message copied into it, at the 
  183. beginning of the next line type
  184.  
  185.     ~p 
  186.  
  187. You might see this:
  188.  
  189.     -------
  190.     Message contains:
  191.     To: nis@oar.net
  192.  
  193.     Here is a message from Paula. She seems to be getting
  194.     used to the e-mail system!
  195.  
  196.     >From paula@osc.edu Wed Mar 10 14:07:55 1993
  197.     >Received:  for you@oar.net
  198.     >    by dialup.oar.net (5.65c+KVa/920824.1144) id AA03676; Wed, 
  199.     10 Mar 1993 14:07:54 -0500
  200.     >Date: Wed, 10 Mar 1993 14:07:54 -0500
  201.     >From: Paula Williams <paula@osc.edu>
  202.     >Message-Id: <199303101905.AA03676@osc.edu>
  203.     >To: you@oar.net
  204.     >Subject: Mail Works!
  205.     >Status: R
  206.     >
  207.     >This is my first mail message. It's great 
  208.     >to be networking with you!
  209.     >
  210.     >Paula Williams
  211.     (continue)
  212.  
  213. Then you could end the message to send it, add additional information, 
  214. or invoke the editor, if you want. You can invoke the editor by typing 
  215. "~v" on a new line by itself. (Notes: To exit the vi editor, type ":wq" 
  216. from the editor. See information on using the vi editor under separate 
  217. cover.)
  218.  
  219. After you have finished composing your mail, type "." alone on 
  220. a line, as usual, to send it. 
  221.  
  222.  
  223. Sending a File by Electronic Mail
  224.  
  225. To send a UNIX file that you have previously prepared by electronic
  226. mail, you need to include it in a message. Reading in a regular file
  227. stored in your directory is similar to forwarding a file. "~r <file>"
  228. on a line by itself, inside your mail message, will copy <file> to your
  229. message. You will have to type "~p" to see your message as it now appears.
  230. Again, you can use "~v" to edit or view the file further.
  231.  
  232.  
  233. Changing the Recipients or Subject of a Mail Message While In Progress
  234.  
  235. "~h" is another useful tilde escape. It will redisplay your "To:" and
  236. "Subject:" lines so you can edit them, and displays "cc:" and "bcc:"
  237. lines so you can specify recipients (including blank carbon copies on 
  238. the "bcc:" line).  Note: if you initiated writing your message with the 
  239. "mail -s" option, your subject will be in the ultimate message, but won't 
  240. show when you use "~h".  
  241.  
  242.  
  243. Executing UNIX Commands From Inside Mail
  244.  
  245. After reading any mail file or at any time during your mail session, 
  246. you may say the following:
  247.  
  248.     !command    execute a UNIX command
  249.  
  250. A useful application of this is "!ls", which you can use to ascertain
  251. the name of a file to which you want to append a message or to ascertain
  252. the name of a file you want to forward to another user.
  253.  
  254.  
  255. Aborting a Message in Progress
  256.  
  257. If you decide you don't want to send a message while you are writing
  258. it, type Control-c twice. Mail will save your "killed" message in the
  259. outside directory as dead.letter. If you decide later you want to
  260. insert part of this file into a mail message you're writing, "~d" will
  261. copy in the contents of dead.letter.  Then you can "~p" and "~v"  to
  262. view and edit your message's new contents.
  263.  
  264.  
  265. Mail Aliases
  266.  
  267. If you find yourself sending mail often to the same group of electronic 
  268. addresses, you may want to set up a mail alias for your private use.
  269.  
  270. Aliases (and customization parameters as discussed in the next section)
  271. that you maintain for your use reside in a special file in your home 
  272. directory. To create an alias, edit the file .mailrc:
  273.  
  274.     vi .mailrc
  275.  
  276. Add some aliases in the form: 
  277.     
  278.     alias <alias_name> <addr1> <addr2> <addr3> <addr4> 
  279.  
  280. Substitute the name of the alias for <alias_name> and the e-mail 
  281. addresses you want to include for the <addr> fields. Do not press Return
  282. between addresses; just extend the line, letting it wrap around. 
  283.  
  284. For example, here is an alias as it might appear in a .mailrc file.
  285. Note that it is one long, continuous line.
  286.  
  287.     alias announce xxbrent@porrima.lerc.nasa.gov zachary@pacific.mps.o
  288.     hio-state.edu steve@aurora.com fielding@theory.tn.cornell.edu hph@
  289.     ms.appstate.edu jlh@ms.appstate.edu 
  290.  
  291.  
  292. Parameters to Modify the Way Your Mail Is Handled
  293.  
  294. Parameters can be set or unset in a .mailrc file in order
  295. to control your mail environment. 
  296.  
  297. These are binary parameters set by the command "set <option>" or unset 
  298. by "unset <option>". 
  299.  
  300.     Binary Options to "set" or "unset"
  301.  
  302.     append        causes any messages saved to be appended to the 
  303.             end of an existing file rather than prepended
  304.     ask        causes mail to prompt you for the subject of each 
  305.             message
  306.     askcc        causes mail to prompt for additional recipients 
  307.             after you initiate sending of a mail message with 
  308.             a period (dot) or Control-d. If you press Return, 
  309.             the previously set list remains the same.
  310.     autoprint    causes the delete (d) command to type the next
  311.             message after deleting the current message
  312.     dot        causes mail to interpret a period alone on a line
  313.             as the terminator of a message
  314.     hold        causes messages to be held so that headers for 
  315.             messages already read will appear the next time
  316.             you type mail (otherwise, mail that has been read
  317.             is stored in a file named mbox) 
  318.     metoo        causes the sender to be included in the expansion
  319.             of an alias
  320.     nosave        prevents aborted messages from being saved in
  321.             the file dead.letter
  322.  
  323. Here is an example of part of a .mailrc with some of the binary parameters 
  324. set. Note: the UNIX system may have some of these set by default. The append, 
  325. ask, and dot options are often set by default.
  326.  
  327.     set metoo
  328.     set hold
  329.     set askcc
  330.  
  331.  
  332. Other Mail Parameters
  333.  
  334. Other mail parameters must be "set" to have a particular value using 
  335.  
  336.     set <param>=<value>
  337.  
  338. Here are some examples. The "record" parameter names a file to which 
  339. the mail system will append a copy of each mail message that you send. 
  340. The "indentprefix" parameter names a character or set of characters used
  341. as a prefix to each line of a forwarded electronic mail message. The 
  342. example of forwarding given above uses the prefix set in the second line.
  343.  
  344.     set record=/home/paula/outbox
  345.     set indentprefix='>'
  346.     set printmail='enscript -Pps'
  347.     set PAGER=/usr/ucb/more
  348.     set VISUAL=/usr/ucb/vi
  349.     set EDITOR=/usr/ucb/vi
  350.     set crt=22
  351.  
  352. For more information on individual parameters, see the man page for mail or 
  353. consult a reference manual.
  354. .
  355.