Guys,
I've been trying to attach & email all txt files from my directory using the shell script below:
#!/usr/bin/sh
################################################################################
send_ml_rej_notn()
{
FILE_NAME=${1}
ATTACH_FILE_NAME=`basename ${FILE_NAME}`
if [ -s ${MAIL_TXT} ]; then
( cat ${CUST_MAIL_HDR} ${MAIL_TXT} ${CUST_MAIL_FOOTER}; \
${FILE_NAME_AP} ${ATTACH_FILE_NAME} ) | mailx -r \
"$MAIL_SENDER" -m -s "${CONST_CUST_MAIL_SUB}" "${CONST_SUPPORT_MAIL_REPT}"
fi
}
ls *txt >${FILE_LIST}
cat ${FILE_LIST}| while read FILE_NAME
do
if [ -s ${FILE_NAME} ] ; then
FILE_NAME_AP="${FILE_NAME_AP} uuencode ${FILE_NAME} ${FILE_NAME} &&"
done
send_ml_rej_notn ${FILE_NAME_AP}
--
The script does the emaling, however the attachments are missing.
The body of the mail contains the message below:
Usage: uuencode [ -m ] [ source ] remotedest
Could someone offer guidance please?.
All that I'm trying is to attach & email all txt files from my directory.
Thank you!!
-Bhagat