The command operates on the user's mailbox if no argument…
The command operates on the user's mailbox if no argument is given. To send an email the message body is built from standard input.
mail --subject="{{subject line}}" {{to_user@example.com}}
mail --subject="{{$HOSTNAME filename.txt}}" {{to_user@example.com}} < {{path/to/filename.txt}}
tar.gz
file as an attachment:tar cvzf - {{path/to/directory1 path/to/directory2}} | uuencode {{data.tar.gz}} | mail --subject="{{subject_line}}" {{to_user@example.com}}