how to send html email from shell script

This is my below script which is working fine as it send only plain text email.

So My question is- How can I modify my below script to send this as an HTML formatted email? I want to show the text color of this expression `(echo "100*$TEST2/$TEST1" | bc -l)` as `RED` in an email and that can be done only in HTML formatted emails. So that is the reason I was thinking to send an email in HTML formatted way. Any suggestions will be of great help.

 #!/bin/bash
    
    TEN_DAYS="3793274 230667"
    
    TEST1=`echo $TEN_DAYS | awk '{print $1}'`
    echo $TEST1
    
    TEST2=`echo $TEN_DAYS | awk '{print $2}'`
    echo $TEST2
    
    mailx -s "Report" -r uname@host.com uname@host.com <<EOF
    
    Error  Percentage: `(echo "100*$TEST2/$TEST1" | bc -l)`
    
    EOF

Use HTML encoding for this...

try to implement HTML tags in it..

read this

Thanks pamu for the link. I know HTML already but I don't know how to add that in the shell script. Can you please give some suggestion basis on my code then I will be able to understand more. Appreciated your help on this.

try something like this...

echo "Subject: Subjecy" > File_Out
echo "FROM: From_name" >> File_Out
echo "To: to@to.com" >> File_Out
echo "Content-Type: text/html; charset=us-ascii" >> File_Out
echo >> File_Out
echo "<!doctype html public \"-//w3c//dtd html 4.0 transitional//en\">" >> File_Out
echo "<html>" >> File_Out
echo "<pre>" >> File_Out
echo "<font size=3 color=blue><b>Message Body</b></font>" >> File_Out

/usr/lib/sendmail "to@to.com" < File_Out