I tried something like below. This gives the attachment and content in body of email. But this is giving content of html as plain text (not in proper html format). How can I modify this code to put body as proper html format
export MAILFROM="
a...@abc.com"
export MAILTO="
a...@abc.com"
export SUBJECT="Test"
export BODY="test.html"
export ATTACH_CSV="test.csv"
csv_file=$( basename "$ATTACH_CSV" )
{
echo "From: $MAILFROM"
echo "To: $MAILTO"
echo "MIME-Version: 1.0"
echo "Subject: $SUBJECT"
echo "Content-Type: multipart/mixed; boundary=\"FILEBOUNDARY\""
echo "--FILEBOUNDARY"
echo "Content-Type: multipart/alternative; boundary=\"MSGBOUNDARY\""
echo "--MSGBOUNDARY"
echo "Content-Type: text/html; charset=iso-8859-1"
echo "Content-Disposition: inline"
cat "$BODY"
echo "--MSGBOUNDARY--"
echo "--FILEBOUNDARY"
echo "Content-Type: text/csv"
echo "Content-Disposition: inline; filename=\"${csv_file}\""
echo "Content-Transfer-Encoding: uuencode"
uuencode "$ATTACH_CSV" "$csv_file"
echo "--FILEBOUNDARY--"
} | /usr/sbin/sendmail -t
Thanks