Basic UNIX Electronic Mail Commands |
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.
~? | to list all tilde (~ ) escapes (i.e. a help display) |
---|---|
~p | to list the text of the message typed in so far |
~s subj | to set or change the current subject field to subj |
~t enams | to add the enams list of email names to the current list of email-names |
~h | to list and to modify the subject and/or the email-names list |
~! cmd | to execute the UNIX command cmd from within mailx utility |
~r fname | to read the file fname into the message at current position |
~v | to invoke the vi editor on the message text to edit it |
~q | to exit mailx, and
to save the current message in the file named dead.letter in your home directory |
mailx
h | to list the headers of the mail messages in your mailbox |
---|---|
<Return> | to continue the current or display (print) the next mail message in your mailbox |
+ or n | to display (print) the next mail message in your mailbox |
- or z | to display (print) the previous mail message in your mailbox |
# | to display (print) the message numbered # in your mailbox |
t MSGS | to display (print) the messages indicated by the message range MSGS |
d MSGS | to delete the messages indicated by the message range MSGS |
s MSGS fname | to saved the messages indicated by the message range MSGS to the file named fname |
R msg | to reply (and send mail) to the authors of the message msg |
r msg | to reply (and send mail) to all the recipients of the message msg |
m name | to send mail message to person named name and enter current message text |
top MSGS | to list the top 5 lines of each message indicated by the message range MSGS |
q | to quit and preserve all unread messages in your mailbox |
x | to quit and preserve all messages in your mailbox |
set ask | to force prompting for a subject for each message you send |
---|---|
set asksub | to force prompting for a list of carbon copy recipients of any messages sent |
set askcc | to enable paged listings of long messages you list/read |
alias new old | to reference old whenever you type new;
e.g. if .mailrc contains alias horton hearsawho@where, then mailx horton sends mail to hearsawho@where. |
alias A B C D | to reference a single group name (A)
when you want to send mail to all the members of that group (B, C, and D); i.e. a convenient way to send a message several people |