commands.sh

mail

all

Operate on the user's mailbox. To send an email the message body is built from `stdin`.

More info →

Options (1)

-h, --helpboolean

Display help

Example: mail {{[-h|--help]}}

Examples (5)

Open an interactive prompt to check personal mail

Send a typed email message with optional CC. The command-line below continues after pressing `<Enter>`. Input message text (can be multiline). Press `<Ctrl d>` to complete the message text

mail --subject "subject line" [email protected] --cc "cc_email_address"

Send an email that contains file content

mail < path/to/file.txt --subject "$HOSTNAME filename.txt" [email protected]

Send a `.tar.gz` file as an attachment

tar cvzf - path/to/directory1 path/to/directory2 | uuencode data.tar.gz | mail --subject "subject_line" [email protected]

Display help

mail [-h|--help]
made by @shridhargupta | data from tldr-pages