Hi All,
I want to send the html file as message body not as an attachment. below is my code.it is printing the html code as it is in the email.
your help is needed urgently.
VTIER=$ROOTHOME/vtierlist2.txt
genhtml=/$ROOTHOME/genhtml.html
MAILTO=/$ROOTHOME/maillist
SUBJECT="Vtier Usage Report"
i=0
j=0
cat /dev/null > $ROOTHOME/genhtml.html
#################array of servers/usage######################
for server in `cat $VTIER`;
do
vtier[$i]=$server
usage[$i]=`sshcmd -u ${vtier[$i]} -s ${vtier[$i]} " df -k ." | awk '{ print $5 " " $6 }' | cut -d " " -f1|tail -1`
echo server=${vtier[$i]} and usage = ${usage[$i]}
i=$i+1
done
##############print the server and usage######################
echo "Content-Type: text/html">>$genhtml
echo "<html>" >>$genhtml
echo "<body>" >>$genhtml
echo "<table border=\"1\">" >>$genhtml
echo "<tr>" >>$genhtml
echo "<td><b> Server </b></td>" >>$genhtml
echo "<td><b> Usage </b></td>" >>$genhtml
echo "</tr>" >>$genhtml
while [ $j -le $i ]
do
echo " <tr>" >>$genhtml
echo " <td> ${vtier[$j]}</td>" >>$genhtml
echo " <td> ${usage[$j]} </td>" >>$genhtml
echo "</tr>" >>$genhtml
j=$j+1
done
echo "</table>" >>$genhtml
echo "</body>" >>$genhtml
echo "</html>" >>$genhtml
cat $genhtml | /usr/ucb/Mail -s "$SUBJECT" `cat $MAILTO`
#uuencode ${genhtml} ${genhtml}|mailx -s "$SUBJECT" `cat $MAILTO`