This works except the date being sent to this script.
Is it because I am trying to write to an executing script?
Is there a better way?
date '+%m-%d-%Y_%I:%M-%p'>> Send_Email.sh
CONTENT="Backup to Maxtor Drive has occured."
echo "Sending email."
/usr/sbin/ssmtp -t << EOF
To: a7@yahoo.com
From: a7@yahoo.com
Subject: Backups to Maxtor Drive
$CONTENT
EOF
------ Post updated at 04:20 PM ------
#Example of a command substitution to put the date into a variable and put that variable in the body of the mail before or after $CONTENT.
NOW=$(date +%m-%d-%Y_%I:%M%p)
#Date_Of_Backup=date +%m-%d-%Y_%I:%M%p
CONTENT="Backup to Maxtor Drive performed on $NOW ."
echo "Sending email."
/usr/sbin/ssmtp -t << EOF
To: a7@yahoo.com
From: a7@yahoo.com
Subject: Backups to Maxtor Drive
$CONTENT
EOF