|
Need help in sending data through mail
Hello there,
I'm trying to send the data stored in a variable through a mail as body of the mail. But not able send the data through mail.
Here is my code:
var1= df -k | awk '{print $1 " " $5}'
echo "This is the alert msg" > mail_body.txt
echo "$var1" >> mail_body.txt
SENDER=test@t.com
RECIPIANTS=test1@t.com
mailx -s "Subject - mail subj" -r ${SENDER} ${RECIPIANTS} < mail_body.txt
Whenever I'm running the script, the recepiant is receivng mail with the body "This is the alert msg'. But not able to receive the data in "var1".
Your help is more appreciate.
|