This may sound like a dumb question, but I have tried and searched a lot of options, and none met my requirements
I am trying to send a mail with a report from unix command line using a bash script, I managed to send it with body and attachment using the mailx service, but the body is unformatted and not pleasing to the eye
(echo "$(cat /tmp/report_summary.html)";uuencode /tmp/report_details.xls report_details.xls) |/usr/bin/mailx -s "Report for XYZ" $MAIL_GRP
I tried the sendmail option, which formats the message body perfectly, but does not have an option for attachment
(
echo "From: [email protected]";
echo "To: [email protected]";
echo "Subject: Test Message 1 2 3";
echo "Content-Type: text/html";
echo "MIME-Version: 1.0";
echo "Content-Disposition: inline";
echo "<HTML><BODY><PRE>";
cat /tmp/report_details.html;
echo "</PRE></BODY></HTML>";
) | /usr/sbin/sendmail -t
I do not have mutt option, but I tried sendmail, mailx and mail service and none is able to help me meet my apparently simple need
Unix OS: Solaris 10 8/07 s10s_u4wos_12b SPARC
Note: Don't tag this as duplicate with existing answers, as they either have option to send attachment or html body or attachment with plain body.
sendmailcommand worked fine when I tried it on my Ubuntu 16.04 system using the Postfix implementation of thesendmailbinary.