Here is a generic mail function I use with cron jobs or scripts that need to email information.
TIP: the context-type can be switched to sent html instead of plain text as well
cat <<EOF | /usr/sbin/sendmail -f noreply -t
To use, set the variables first, then call the function
subject="This is the email subject"
This is is the text
that is sent
in the body of the email.
That's just one way of calling it. You could use read, could use it as a one line command ... possibilities are endless
Hope someone else finds it useful.