Now its time to send an email attachment using mail command a shown.
$ echo "Message Body Here" | mail -s "Subject Here" user@example.com -A backup.zip
In the above command, the flag:
-s
– specifies the message subject.-A
– helps to attach a file.