Hi,
I am trying to attach a .log file or .txt file to mail command to send an email once my ksh script executed. I am unable to use mutt command as it has been not installed and i am not supposed to install it. I have tried many ways by googling which has not helped me to succeed.
Here is my requirement,I need to run some 10 sql queries and result need to send in the email via attachment. I have Check.ksh and i am running this by using nohup command.
nohup Check.ksh > Valid_Check.log 2>&1 &
In Check.ksh
typeset var TO="name@domain.com";
typeset var SUB="Report";
typeset var BODY="Check Completed";
typeset var ATTACHMENT=${FILE_PATH}/Valid_Check.log
if [ -f "${ATTACHMENT}" ]; then
echo "Log file exist";
else
echo "No Log File";
fi
uuencode Valid_Check.log Valid_Check.log | mail -s "${SUB}" "${BODY}" ${TO}
and tried the below as well
#mailx -s "${SUB}" "${TO}" "${BODY}" < ${FILE_PATH}/Valid_Check.log
#cat ${FILE_PATH}/Valid_Check.log | mailx -s "${SUBJECT}" "${TO}" "${BODY}";
uuencode Valid_Check.log Valid_Check.log | mail -s "${SUB}" "${BODY}" ${TO}
But getting an error like "Valid... User unknown"
Any inputs would be helpful or any other simple/easy approach?
Thanks,