From 3452d9e7d7b8aba62e1ea9fc9b8f45f4de3d3c86 Mon Sep 17 00:00:00 2001 From: Michele Cereda Date: Sun, 17 Apr 2022 23:19:24 +0200 Subject: [PATCH] Added email notes to the knowledge base --- knowledge base/send an email from cli.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 knowledge base/send an email from cli.md diff --git a/knowledge base/send an email from cli.md b/knowledge base/send an email from cli.md new file mode 100644 index 0000000..9e3957e --- /dev/null +++ b/knowledge base/send an email from cli.md @@ -0,0 +1,22 @@ +# Send an email from CLI + +## TL;DR + +```shell +mail -s "Subject" recipient@mail.server +echo "" | mail -a attachment.file -s "Subject" recipient@mail.server + +# send larger files +cat file.txt | mail -s "Subject" recipient@mail.server + +# make "email-safe" the contents of a file +uuencode file.txt | mail -s "Subject" recipient@mail.server +``` + +## Further readings + +- [linux mail command examples] +- [uuencode] + +[linux mail command examples]: https://www.binarytides.com/linux-mail-command-examples +[uuencode]: https://linux.101hacks.com/unix/uuencode/