So I know how to use the mail command to send mail through ssh, as in typing
mail -s "Subject here" firstname.lastname@example.org, 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!