mail -- implementation of Berkeley mail(1)
mail [-f mailbox]
mail [-s subject] [-c cc-addrs] [-b bcc-addrs] to-addr [..toaddr..]
When called without command-line options (except -f) mail allows the user to interactively send mail, and manage a mail folder. Otherwise, mail allows the user to send outgoing E-mail to recipients.
When run interactively, the mail folder ~/mbox is used. If the home directory cannot be determined, ./mbox is assumed. This can be overridden with the -f option.
mail accepts the following options
Specifies a mail folder to use.
Specify a subject for the mail message.
A comma-separated list of addresses to be copied to on the mail message.
A comma-separated list of addresses to be copied to on the mail message, without appearing in the headers.
E-Mail destination addresses. You may not be notified if mail fails to deliver to the address properly.
In the list below, "msg" indicates a message list. Acceptable values are comma or space separated lists, ranges (i.e. 1-5) or single digits. Special values are "$" (end of list) and * (all messages). If messages are unspecified, the current message is used. "path" indicates a filename argument. "addr" indicates a mail message address list (comma or space separated).
Read message number.
Execute the "command" with the command interpreter.
Copy indicated messages (msg) to filename at path. co is an alias for this command.
Delete indicated messages. d is an alias for this command.
Exit the mail program saving no changes to the mailbox. x is an alias for this command.
Display the headers from the specified messages. f is an alias for this command.
Display a brief list of headers from the messages. h is an alias for this command.
Mark messages as unread. ho,preserve are aliases for this command.
Send a mail message to addr. m is an alias for this command.
Print the next message in sequence. n is an alias for this command.
Print the specified mail message. p,CR are aliases for this command.
Exit the mail program. The (possibly) edited mailbox is re-written to its original file. See Bugs. q is an alias for this command.
Reply to the original sender of msg. r is an alias for this command.
Reply to the original sender, and all visible recipients of msg. R is an alias for this command.
Save msg into the file specified at path. If the file exists, it is appended. s is an alias for this command.
Start an interactive bourne shell. (This does not work under Win32). sh is an alias for this command.
Display the first few lines of the current mail message.
Mark as undeleted any specified mail messages. u is an alias for this command.
Mark as unread any specified mail messages. U is an alias for this command.
Invoke the visual editor (specified in $VISUAL, or /usr/bin/vi) on the indicated messages. Re-read those messages in afer the editing session. v is an alias for this command.
Write the bodies of the indicated messages to path. w is an alias for this command.
When sending a mail message (commands mail, reply or Reply) a primitive line-mode editor is used to get the body of the mail message, and possibly change any header options. During the editing session, special commands may be used when typed at the beginning of the line.
To send the message, send an EOF character or a "." on a line by itself.
Change message subject to subject.
Quit the message editor. No changes are made, no message is sent.
Add the addrs to the CC list for the message
Add the addrs to the BCC list for the message
Add the addrs to the To: list for the message
Read the specified messages into the current message at the end.
Read the specified messages into the current message at the end, indenting each line with the sequence "> ".
Read the contents of file into the message.
Invoke the visual editor on the message. When the user is done editing the message, read the message back in, and continue editing at the end.
Numerous. Mostly lack of refinement in the implementation, any of which can be fixed without hassle, I'm sure.
$LOGNAMEin your environment to see who you are (for a From address). It then searches for an SMTP agent on localhost. Not finding that, it wants $RELAYHOST set to your SMTP relaying host name. Your reply address is taken from $REPLYADDR or your system's environment. Whichever is easier. Win32 systems, be prepared to setup your environment properly for this to work!
The Perl implementation of mail was written by Clinton Pierce, firstname.lastname@example.org.
This program is Copyright 1999, by Clinton Pierce.
Freely redistributable under the Perl Artistic License.