Emailing html file as body not attachment

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`

Add this on top of your html file

 
To: To mail id
From: From mail id
Subject: Sub 
MIME-Version: 1.0
Content-Type: text/html

send the mail using following command

 
cat htmlfile | /usr/lib/sendmail -t

replace

cat $genhtml | /usr/ucb/Mail -s "$SUBJECT" `cat $MAILTO`

to
 
cat $genhtml | /usr/sbin/sendmail address@example.com 

sendmail supports html

Send HTML formatted mail from Unix using Sendmail - Tech-Recipes

thanks a lot Kamraj...it solved my problem..
one more question - the mail is send as host name as the sender..I want my email address in sender list..is there any option for that in sendmail..

Add this on top of your file

 
From: aa@mail.com

try this..

(
echo "From: you@your_company.com"
echo "To: you@your_company.com"
echo "MIME-Version: 1.0"
echo "Subject: Test Message"
echo ""
echo "This is a MIME-encapsulated message"
echo ""
echo "Content-Type: text/html"
echo ""
cat $genhtml
) | sendmail -t

Thanks..

I tried the above code but it is not working..and printing the from:,to:,MIME type (in echo command) as it is in the output.:frowning: