I am trying to send an email using below shell. However, at a time, this command is sending content in email body and not as an attachment. Please suggest what could be the correct syntax or logic to send both email body and attachment together in a single mail.
smtpserver="0.0.0.0"
sender="email_id"
subject="subject"
MSG="message"
ReportFile="<PATH>/attachment.csv"
CLASSPATH="<classpath>/attachment.csv"
htmlfile="output.html"
java -cp $CLASSPATH:$CLASSPATH/ojdbc6.jar ClassFile > $ReportFile
awk -F, 'BEGIN{
FS=",";
print "data shown as below"
print "<html><body><table>"
}
{
for(i=1; i<=NF; i++)
{
print "<td>" $i "</td>"
}
print "</tr>"
}
END{
print "<html><body><table>"
}
' $ReportFile > $htmlfile
/home/mailsend-smtp $smtpserver -content-type 'text/html' -mime-type
"text/html html" -t $receiver -f $sender -sub "$subject" -msg-body
$htmlfile -attach $ReportFile