So I know how to use the mail command to send mail through ssh, as in typing
mail -s "Subject here" email@example.com, then typing out the message, hitting CTRL + D to stop composing, then press enter to not have a Cc.
How I'm curious, how would I send an email through a non-interactive shell script? Just so I can send an email if a backup decided to fail, or whatever reason.
Thanks a bunch!