Monday 15 January 2018

linux - Send the output of html file within the email body

I have an html file under /tmp
folder
as chart.html file which will have the
output like below image when you open that html
file



src="https://i.stack.imgur.com/xykvB.png" alt="enter image description
here">



I have a shell script that I am using
to send the chart.html file as an attachment in an email with
some body message.



Problem
Statement:-




Is is
possible to send this colorful image of the html file(when you open it) within the body
of an email? So that people can see this image in there email body, instead of opening
the attachment file. Below is the command that I am using to send the attachment in an
email with body message-



mailx -s
"LIP Data Quality Report for $DATE_YEST_FORMAT1" -r rj@host.com rj@host.com
<Data Successfully loaded into LIP_DATA_QUALITY
table

Total Items Purchased: `echo $QUERY1 | awk '{print
$1}'`

Total Items MissingorMismatch: `echo $QUERY1 | awk '{print
$2}'`


Error Percentage:
$QUERY2

$(uuencode /tmp/chart.html
percentage_graph.html)

EOF


What
changes I need to make in my above command to send this colorful image within the body
itself.

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...