bash mail - ghdrako/doc_snipets GitHub Wiki

echo "<^>Here add your email body<^>" | mail -s "<^>Here
specify your email subject<^>"
<^>[email protected]<^>

If you need to send files as attachments, you can use mpack. To install mpack run the following command:

sudo apt install mpack

Next, in order to send an email with a file attached, run the following command.

mpack -s "<^>Your Subject here<^>" your_file.zip
<^>[email protected]<^>