mail — stdin stdout - file -- opt --help --version
mail [options
]recipient
The mail
program is a quick,
simple email client. Most people want a more powerful program for
regular use, but for quick messages from the command line or in
scripts, mail
is really
handy.
To send a quick message:
➜mail [email protected]
Subject:my subject
I'm typing a message.
To end it, I type a period by itself on a line.
.
Ends the message EOT ➜
To send a quick message using a single command, use a pipeline:
➜ echo "Hello world" | mail -s "subject" [email protected]
To mail a file using a single command, you can use redirection or a pipeline:
➜mail -s "my subject" [email protected] < filename
➜cat filename | mail -s "my subject" [email protected]
Notice how easily you can send the output of a pipeline as an email message; this is useful in scripts.
13.58.216.74