echo "<html>" > email.html
echo "<body>" >> email.html
awk 'BEGIN {print "<table border=2 cellspacing=1 cellpadding=3>" \
"<tr><th>S No.</th><th>Day</th><th>Date</th><th colspan=2>Last Business Day & Date</th>"} \
{print "<tr>";for(i=1;i<=NF;i++)print "<td>" $i"</td>";print "</tr>"} \
END{print "</table>"}' table >> email.html
echo "</body>" >> email.html
echo "</html>" >> email.html
this is the basic structure of the email file I'm creating. But when I use
mail -s "$(echo -e "Subject\nContent-Type: text/html")" abc@xyz.com < email.html
I get the output in form of html source file, but not the actual table.