我要存储在一个HTML文件我矩阵的数据,并在Outlook中发送电子邮件,我的代码如下:如何使用shell脚本中的邮件发送html文件?
printf "<!DOCTYPE html>"
printf "<html>"
printf "<head>"
printf "<style>"
printf "</style>"
printf "</head>"
printf "<body>"
printf "<table>"
printf "<tr>"
printf "<th>Total</th>"
printf "<th>StillFail</th>"
printf "<th>Pass</th>"
printf "<th>ScriptError</th>"
printf "<th>APIName</th>"
printf "</tr>"
printf "<tr>"
echo
for ((j=1;j<=num_rows;j++)) do
printf "<tr>"
for ((i=1;i<=num_columns;i++)) do
printf "<td>"
printf "${matrix[$j,$i]}"
printf "</td>"
printf "</tr>"
done
echo
done
printf "</tr>"
printf "</table>"
printf "</body>"
printf "</html>"
#mailx -a 'Content-Type: html' -s "my subject" [email protected] < output.html
mailx -s "TESTING MAIL"</home/tapariak/keshav/output.html "[email protected]"
我想我的输出是一个很好对齐的表格。有人可以帮助我吗? TIA
什么的输出呢? 'mailx -a'Content-Type:html'-s“我的主题”[email protected]
我的脚本名是parseScript.sh,所以当我运行这个脚本时,我运行如下:./parseScript .sh> output.html,这样我的输出应该存储在output.html中,然后我使用邮件邮寄那个文件 –
我不明白你在说什么你的邮件是content-type'text'把它改为'html '你在用'mailUtils'吗? –