1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-29 23:24:55 +02:00
tldr/pages/common/mail.md

22 lines
856 B
Markdown
Raw Normal View History

2019-09-16 13:03:43 -04:00
# mail
> The command operates on the user's mailbox if no argument is given.
> To send an email the message body is built from `stdin`.
> More information: <https://manned.org/mail>.
2019-09-16 13:03:43 -04:00
- Open an interactive prompt to check personal mail:
2019-09-16 13:03:43 -04:00
`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}}" {{to_user@example.com}} --cc="{{cc_email_address}}"`
2019-09-16 13:03:43 -04:00
- Send an email that contains file content:
`mail --subject="{{$HOSTNAME filename.txt}}" {{to_user@example.com}} < {{path/to/filename.txt}}`
2019-09-16 13:03:43 -04:00
- Send a `tar.gz` file as an attachment:
2019-09-16 13:03:43 -04:00
`tar cvzf - {{path/to/directory1 path/to/directory2}} | uuencode {{data.tar.gz}} | mail --subject="{{subject_line}}" {{to_user@example.com}}`