Solaris Advanced User's Guide

Using vi With mailx

You can use the vi text editor to compose messages while you run mailx. vi enables you to correct mistakes and add and delete text before you send your messages. If you are not already familiar with using vi, refer to Chapter 6, Using the vi Editor for instructions.

In the mailx program, you can use the standard vi commands for inserting, deleting, and changing text.

To write a message with vi:

  1. Type the mailx command with an address at either the mailx prompt (&) or the command prompt ($).

  2. Type the subject at the Subject: line. Press Return.

  3. Start vi by typing the command ~v on a new line.

    The vi screen appears, representing an empty file in your /tmp directory.

  4. Use vi commands to type and edit the body of your message.

  5. When you are finished, quit vi with the command :wq or ZZ.

    After you quit vi, mailx displays the (continue): message. You can either add to the message (outside vi) or send the message by pressing Ctrl-D.