The commands are similar to mail
. For example:
mailx user@host.domain
or mailx aliasname
Type the message text, terminate and send your
message with <Ctrl-d> or with a last line containing
a single . (period) in column one.
Mail a file:
mailx -s "subject" recipient-address < filename
Reading, forwarding, replying, filing, sorting and
editing mail are done inside the mail utility. Invoke:
mailx
then use any of the following subcommands:
m send mail, invoke editorh header displays list of messages in your mailbox
? help
d delete current message
e edit the current message
[n] read message number [n]
[-] read previous message
s save current message in personal mailbox
s file save current message to file
s [n] file save message number [n] to file
c [n][file] same as s but do not delete message from incoming mailbox
r reply to current message
a display aliases
a hd display alias hd
q quit mail, discard deleted messages
x quit mail, do not discard deleted messages
Note: Ultrix, HP-UX and AIX use r to reply to all the people contained within the To and CC: lists and R to reply to the sender only. In SunOs the reverse occurs. However, the man pages on the different systems correctly describe the behaviour on the different systems.
By default mail uses the vi editor. Insert a line
set EDITOR=/usr/local/bin/emacs
into your $HOME/.mailrc
file to change the default editor to emacs.
If you want to work with your personal mailbox
instead of the system mailbox, type
mailx -f
.
Work with an arbitrary mail folder is started as
mailx -f filename