P_ATTFILE=`echo "$1"|cut -d'"' -f10`
P_MAIL_TO=`echo "$1"|cut -d'"' -f12`
P_FILE=`echo "$1"|cut -d'"' -f14`
P_BODY=`echo "$1"|cut -d'"' -f16`
P_ATTFILE1=`echo "$1"|cut -d'"' -f18`
P_FILE1=`echo "$1"|cut -d'"' -f20`
P_FROM=`echo "$1"|cut -d'"' -f22`
CC_LIST=""
echo "Subject :"$P_SUBJECT
echo "File_Name :"$P_ATTFILE
echo "EMail To :"$P_MAIL_TO
echo "File :"$P_FILE
echo "BODY :"$P_BODY
echo "P_ATTFILE1:"$P_ATTFILE1
echo "P_FILE1 :"$P_FILE1
echo "CC :" $CC_LIST
echo "EmailFROM :" $P_FROM
value1=$(cat $P_BODY)
echo "$value1"
(echo "$value1"; uuencode $P_ATTFILE "$P_FILE"; uuencode $P_ATTFILE1 "$P_FILE1") |mailx -s "$P_SUBJECT" -c "$CC_LIST" "$P_MAIL_TO" -- -r "$P_FROM"
if [ $? -ne 0 ]
then
echo ""
echo "Fail to send mailto ${P_MAIL_TO} with mail subject ${P_SUBJECT} and file $P_ATTFILE"
echo ""
exit 1
fi
exit 0
No comments:
Post a Comment