Invoking Mail To Send Messages
To invoke the UNIX mail utility program to send messages, type
mailx email-names
or
mailx -s subject email-names
where email-names is a list of electronic mail names of people to whom you wish to send the message and subject is the subject (or title) of the message being sent. The email name may be as simple as name or name@machine or may require the name followed by a fully qualified host/domain name (e.g.name@CS.ColoState.Edu). If the mailx command does not prompt you for a subject (which is nice to include for the receiver of the mail), it can be included with the -s option.
After invoking the mailx utility, simply type in lines of text (hit the <Return> key after entering each text line). When you are done entering the message, hit<Ctrl>-D (at the start of a new line) to send the message (and exit back to the system or UNIX prompt). To abort a message and exit mailx, type <Ctrl>-C twice.
Message Text Commands
Tilde escapes are entered at the start of a text line (when entering mail message text) to perform some useful operations. Hit the <Return> key after entering a tilde escape sequence/command.
Invoking Mail To Receive Messages
To invoke the UNIX mail utility program to receive messages, type
mailx
A response "No mail for user_name" means there are no new or old saved mail messages. Entering the utility means you have mail (when you log in the system informs you if you have mail).
The following commands may be used within mailx:
Notes on Above Table of Commands:
MSGS specifies messages by number, author, subject or type. The default is the current message.
A range of MSGS by number is of the form, for example, of 2 3 4 or of 2-4 (meaning the messages numbered 2 through 4).
msg is the number of a message and defaults to the current message.