OpenWindows Advanced User's Guide

7.5 Sending Letters

To send mail with the mailx program, you need to know the login name(s) of the intended recipient(s) of your letter. If an intended recipient is on a different machine, you also need to know that user's machine name. To determine this information, you can use the who, finger, or rusers commands.

Typing the who command lists all the users who are currently logged in to the file server you are on. The displayed list contains user's login names, their terminal types, and the date and time they logged in. For example:

$ who
    elmer      tty15        Feb 20 10:22
    susan      tty04        Feb 20 10:37
    stormy     tty07        Feb 20 11:49
    hankw      tty06        Feb 20 12:02

Typing the finger command displays the same type of information as who with a little more detail. The information that appears depends on how your system administrator has set up this command. As an example, you may see something like the following:

$ finger
    Login     Name           TTY      Idle     When
    elmer     Elmer Brown    tty15     43      Thu 10:22
    susan     Susan Lake     tty04             Thu 10:37
    stormy    Stormy Ball    tty07     12      Thu 11:49
    hankw     Hank Wilson    tty06     22      Thu 12:02

The rusers command provides information on the users currently logged in to your local network. Refer to Chapter 9, Using the Networkfor instructions regarding the use of the rusers command.

When you have determined the necessary user information, complete the following steps to send a letter.

  1. Type the mailx command followed by a user's address:

    $ mailx user@machine

    where user is the intended recipient's login name and machine is the name of the intended recipient's machine.

    • If you've already started mailx, you can just type m at the mailx prompt, followed by the intended recipient's login and machine name:

      & m user@machine

    • To send the same letter to multiple recipients, separate each address with a space or a comma, for example:

      $ mailx hank@fretful sally@dakota tex@twister


      $ mailx hank@fretful,sally@dakota,tex@twister

  2. When you press Return, the mailx program prompts you for a subject. Type a subject for your letter and press Return again.

  3. Type the body of your letter. When you want to create a new line, press Return.

    A sentence that wraps on your screen is not considered a new line until you press Return.

    Note -

    Each line of text within your letter can be up to 256 characters long. When you exceed this limitation, your screen will freeze. If this occurs, press Ctrl-C to abort your letter.

  4. When you have completed your letter, press Return to move the cursor to a new line. Then press Ctrl-D to send your letter.

7.5.1 Undeliverable Letters

If you specify an incorrect user address when you send a letter, the system responds with the message

user@machine...User unknown

and the letter is returned to your mailbox. The next time you type the mailx command, the header states that you have returned mail, similar to the following example:

N 1 Mailer-Daemon Fri Jan 3 11:13 8/49 Returned mail: User unknown

When a letter cannot be delivered, the file is also copied to a file in your home directory named dead.letter.

7.5.2 Canceling an Unsent Letter

You can cancel a letter at any time before it is sent by pressing Ctrl-C twice.

7.5.3 Adding Carbon and Blind Carbon Copies

Before sending a letter, you can specify that "carbon copies" be sent to other than the main addressees. You can also send "blind carbons." (Recipients of your letter can read the addresses for the carbon copies, but not the addresses for the blind carbons.)

Many people send themselves carbons or blind carbons in order to retain a copy for their own record.

There are three methods for sending carbon copies with a letter:

~c hank@fretful george@lonesome stormy@snoozer

7.5.4 Inserting a Copy of a Letter or File

You can insert a copy of any letter in your mailbox into the letter you're writing. Likewise, you can insert a copy of any text file. Inserting a Letter

The command form to insert a letter is

~m number

where number is the number of the letter to be inserted. For example, to send a letter to another user that includes a copy of letter number 3 from your mailbox list, you would do the following:

  1. On a new line give the command ~m 3 and then press Return.

  2. mailx displays the message, Interpolating: 3 (continue)

  3. You won't see the text of message 3, but the recipient will. You can go on with your letter after (continue), or you can send it as is.

  4. To see the complete letter, interpolation included, type the command ~p. Inserting a File

You can also insert a copy of any text file into a letter. Use the command form:

~r filename

as you're writing a letter. For example, to insert the file outline in the current letter, type:

~r outline

7.5.5 Replying to a Letter

Reply to mail by giving the command

r number

at a mailx prompt. (If you omit the letter number, mailx replies to the current letter.) For example, to reply to the sender of letter 2, give the command:

& r 2

mailx automatically addresses your letter and supplies an Re: Subject: line that echoes the original Subject: line. Send your reply like any other letter.

R is a variant of the reply command that sends your reply to all recipients of the original letter as well as to its sender. Use this command only when absolutely necessary, to avoid generating "junk mail."

Note -

You can insert a letter into your reply as shown in the previous section. To insert a copy of the letter to which you are replying, just give the command ~m without a letter number.