Go to the previous, next section.

What to do when sending mail

After you type the command to send mail, the system may prompt you for a subject. Your subject may be up to one line long.

After typing the subject (if your system prompts you for one) , you can type your letter. Note that mail doesn't have a prompt when you're sending mail; it just sits there waiting for you to type. You can enter as many lines of text as you want.

To get help while in the mail facility, type the following:

? on a line by itself followed by a carriage return

This will bring up a collection of commands that can be used from inside a mail message. The most useful of these is v, which causes your mail message to be put into an editor (default vi) so that you can edit the mail message. (This looks at the value of the VISUAL environment variable. Change this variable if you want to use a different editor)

If you decide in the middle of typing your letter that you don't want to send the letter or that you want to save it and finish it later, type ctrl-c twice. This saves the contents of your letter in a file called "dead.letter." You can then delete the dead.letter file or edit it and send it at a later time. To send a letter that you saved in the dead.letter file, type the following:

mail -s "subject" login < dead.letter

Note: If the letter is not saved into dead.letter, and you want this option, your .mailrc file will have to be modified. Invoke an editor and bring up your .mailrc file. Remove only the word "nosave" from the file. Save the file. From then on, each time you use mail, the cancelled mail will be saved in the file dead.letter. When you're done with your letter, type ctrl-d to get out of the mail facility and back to the UNIX prompt. When you type ctrl-d, mail sends your letter to the user who's login you named when you invoked mail.

Go to the previous, next section.