I have written a script which makes a html table in mail body , I want to send a file/zip as attachment using mail command and uuencode but somehow its not working inside bash script but works from console .
mailbody="<html><table><th><tr><td>Name</td><td>Age</td></tr></th><tr><td>\
ABC</td><td>25</td></tr></table></html>"
echo $mailbody>>mailer.txt
#assume i have test.txt or test.zip which i need as attachment in mail
#i tried below with html part as body
uuencode test.txt test.txt|mail -s "Test mail\nContent-Type: text/html" "xyz.com" <mailer.txt
this sends mail with mail body showing html Table but attachment is missing .
uuencode test.txt test.txt|mail -s "Test mail" "xyz.com" properly send mail with test.txt as attachment but a plain mail , no html
thanks in advance