You can use the vi text editor to compose letters while running mailx. This gives you the capability of correcting mistakes and adding and deleting text before you send your letters. If you are not already familiar with using vi, refer to Chapter 6, Using the vi Editorfor instructions.
In the mailx program, you can use the standard vi commands for inserting, deleting, and changing text.
To write a letter with vi:
Give the mailx command with an address at either the mailx prompt (&) or the command prompt ($).
Type in the subject at the Subject: line. Press Return.
Use vi commands to input and edit the body of your letter.
When done, quit vi with the command :wq or ZZ.