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 ;) IE:
subject="This is the email subject"
This is is the text
that is sent
in the body of the email.