2025-03-14 21:59:59 -06:00
# mail
2025-07-24 22:27:13 -06:00
> Operate on the user's mailbox.
2025-03-14 21:59:59 -06:00
> To send an email the message body is built from `stdin`.
> More information: <https://manned.org/mail>.
- Open an interactive prompt to check personal mail:
`mail`
2025-03-19 19:23:44 -06:00
- 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:
2025-03-14 21:59:59 -06:00
2025-03-19 19:23:44 -06:00
`mail --subject "{{subject line}}" {{to_user@example.com}} --cc "{{cc_email_address}}"`
2025-03-14 21:59:59 -06:00
- Send an email that contains file content:
2025-03-19 19:23:44 -06:00
`mail --subject "{{$HOSTNAME filename.txt}}" {{to_user@example.com}} < {{path/to/filename.txt}}`
2025-03-14 21:59:59 -06:00
- Send a `tar.gz` file as an attachment:
2025-03-19 19:23:44 -06:00
`tar cvzf - {{path/to/directory1 path/to/directory2}} | uuencode {{data.tar.gz}} | mail --subject "{{subject_line}}" {{to_user@example.com}}`
2025-04-03 20:36:56 -06:00
- Display help:
`mail {{[-h|--help]}}`