🖥️mail

➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the mail command with important options and switches using examples.

▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁

#                ███╗   ███╗ █████╗ ██╗██╗     
#                ████╗ ████║██╔══██╗██║██║     
#                ██╔████╔██║███████║██║██║     
#                ██║╚██╔╝██║██╔══██║██║██║     
#                ██║ ╚═╝ ██║██║  ██║██║███████╗
#                ╚═╝     ╚═╝╚═╝  ╚═╝╚═╝╚══════╝
                                              
                                           

#=============#
# CMD MAIL
#==============================##==============================#
echo "hello world" | mail -s "a subject" [email protected]
#

echo "This will go into the body of the mail." | mail -s "Hello world" [email protected]
#

mail -s "Hello world" [email protected] < /home/calvin/application.log
#

top -b -n 1 | mail -s "any subject" [email protected]
#

mail -s "Your Subject" [email protected] < /file/with/mail/content
#(/file/with/mail/content sh		ould be a plaintext file, not a file attachment or an image, etc)

echo "Sending an attachment." | mutt -a file.zip -s "attachment" [email protected]
#

# ENTER then type message body then CTRL+D.
mail -s “Hello world” [email protected]

# Otherwise, 
echo "This will go into the body of the mail." | mail -s "Hello world" [email protected]

# Or parse from file, 
mail -s “Hello world” [email protected] < /tmp/message.log

# Use mutt for attaching file, 
echo “Sending an attachment.” | mutt -a backup.zip -s “attachment” [email protected]

# Datei sich per Email zusenden
cat DATEI | mail -s MAILSUBJEKT [email protected]

wait_for_this.sh; echo "wait_for_this.sh finished running" | mail -s "Job Status Update" [email protected]
# Send an email from the terminal when job finishes

echo "This is the message body" | mutt -a "/path/to/file.to.attach" -s "subject of message" -- [email protected]
gzip -c mysqldbbackup.sql | uuencode mysqldbbackup.sql.gz  | mail -s "MySQL DB" [email protected]

mail -s "Backup" -a mysqldbbackup.sql [email protected] < message.txt
or also:
cat message.txt | mail -s "Backup" -a mysqldbbackup.sql [email protected]

EHLO test.example.com
MAIL FROM:<ABSENDERADRESSE>
RCPT TO:<EMPFÄNGERADRESSE>
DATA
Subject: Testnachricht
(Leerzeile, erneut Enter drücken)
Das ist ein Test.
(Leerzeile, erneut Enter drücken)
.
QUIT

#==============================##==============================#
# CMD MAIL					       #
#==============================##==============================#
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

  █║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌

              ██╗ ██╗ ██████╗  ██████╗ ██╗  ██╗███████╗██████╗
             ████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
             ╚██╔═██╔╝██║  ██║██║   ██║ ╚███╔╝ █████╗  ██║  ██║
             ████████╗██║  ██║██║   ██║ ██╔██╗ ██╔══╝  ██║  ██║
             ╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
              ╚═╝ ╚═╝ ╚═════╝  ╚═════╝ ╚═╝  ╚═╝╚══════╝╚═════╝

               █║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌

░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░