2019-09-16 13:03:43 -04:00
# mail
> The command operates on the user's mailbox if no argument is given.
2023-08-09 07:29:02 +02:00
> To send an email the message body is built from `stdin`.
2021-10-05 17:50:45 +05:00
> More information: <https://manned.org/mail>.
2019-09-16 13:03:43 -04:00
2024-10-16 10:02:06 +03:00
- Open an interactive prompt to check personal mail:
2019-09-16 13:03:43 -04:00
2024-10-16 10:02:06 +03:00
`mail`
2025-03-09 03:23:24 +02: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:
2024-10-16 10:02:06 +03:00
2025-03-07 13:45:30 +02:00
`mail --subject "{{subject line}}" {{to_user@example.com}} --cc "{{cc_email_address}}"`
2019-09-16 13:03:43 -04:00
- Send an email that contains file content:
2025-03-07 13:45:30 +02:00
`mail --subject "{{$HOSTNAME filename.txt}}" {{to_user@example.com}} < {{path/to/filename.txt}}`
2019-09-16 13:03:43 -04:00
2021-01-31 14:05:18 -03:00
- Send a `tar.gz` file as an attachment:
2019-09-16 13:03:43 -04:00
2025-03-07 13:45:30 +02:00
`tar cvzf - {{path/to/directory1 path/to/directory2}} | uuencode {{data.tar.gz}} | mail --subject "{{subject_line}}" {{to_user@example.com}}`
2025-03-26 00:36:41 +02:00
- Display help:
`mail {{[-h|--help]}}`