How to display Html Tabular Data in email Body using Mailx or Mutt

百般思念 提交于 2020-01-25 09:42:10

问题


I have a Scenario where i am having one .csv file called Studentdetails.csv

The student details has below following data

   Ram,Mumbai,MBA

   Viraj,Delhi,MCA

   Vilas,Kolkata,MMS

   Priya,Agra,BCA

My below code convert .csv file to html table format file

awk 'BEGIN{
FS=","
print  "MIME-Version: 1.0"
print  "Content-Type: text/html"
print  "Content-Disposition: inline"
print  "<HTML>""<TABLE border="1"><TH>Name</TH><TH>City</TH><TH>Course</TH>" 
}
 {
printf "<TR>"
for(i=1;i<=NF;i++)
printf "<TD>%s</TD>", $i
print "</TR>"
 }
END{
print "</TABLE></BODY></HTML>"
 }
' file-to-convert.csv > StudentDetails.html

But my issue is How do i Display this HTML Tabular format in Body of mail using mutt or mailx command

Note: Not as attachment

Output should be display in mail like below html tabular format

来源:https://stackoverflow.com/questions/58206219/how-to-display-html-tabular-data-in-email-body-using-mailx-or-mutt

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!