1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-24 01:22:10 +02:00
tldr/pages/common/mail.md
Lena d427f333b2
pages/*: add backticks around I/O streams (#10436)
* as suggested in #10428
* standard input  => `stdin`
* standard output => `stdout`
* standard error  => `stderr`

Co-authored-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
2023-08-09 10:59:02 +05:30

795 B

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.

  • Send a typed email message. The command-line below continues after pressing Enter key. Input CC email-id (optional) press Enter key. Input message text (can be multiline). Press Ctrl-D key to complete the message text:

mail --subject="{{subject line}}" {{to_user@example.com}}

  • Send an email that contains file content:

mail --subject="{{$HOSTNAME filename.txt}}" {{to_user@example.com}} < {{path/to/filename.txt}}

  • Send a 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}}