mail (Unix)

From Wikipedia, the free encyclopedia


mail is a command line e-mail client for Unix and Unix-like operating systems.

[edit] Example usage

 mail -s "You've got mail" -c cc.rider@b.c somebody@example.com anotherbody@example.net

This sends a message with the subject "You've got mail" to two recipients, somebody and anotherbody, and CCs (copies) a third, cc.rider. The message will be typed after the command is entered and will be ended with Control-D.

If you want to send a message in one line, use any Unix command sequence that generates text. For example:

 echo "Some message" | mail -s "meeting today" somebody@example.com 

This is especially useful for having a system report its status automatically through E-mail.

There is also a -a option for using an ISO-8859 character set beyond US Ascii. For instance:

 mail -s "You've got mail" -a ISO-8859-8 somebody@example.com

The -a ISO-8859-8 option tells Mail that the message may include Hebrew characters.

Languages