Send mail with font color change

Hi All,
I have a file that contains following entries.
I want to highlight the line that has word as "FAILURE" while sending the email.

File

------------------------------------------------------------

Job Name:       ABC
Start Time:     07/20/2019 07:32:39
End Time:       07/20/2019 07:32:42
Status:         SUCCESS 07/20/2019 07:32:42

------------------------------------------------------------

Job Name:       DEF
Start Time:     07/20/2019 07:32:19
End Time:       07/20/2019 07:32:21
Status:         FAILURE 07/20/2019 07:30:26
Status:         SUCCESS 07/20/2019 07:32:21

------------------------------------------------------------

Job Name:       GHI
Start Time:     07/20/2019 07:30:06
End Time:       07/20/2019 07:30:08
Status:         SUCCESS 07/20/2019 07:30:08

------------------------------------------------------------

I am using following simple method to send mail, but not familiar how to change the font of particular text where error is seen.
Pls help

{
echo "From: "
echo "To:  abc@xyz.com
echo "Subject: Status Report - for jobs -- $DATE"

cat /tmp/report.$DATE
} | /usr/sbin/sendmail -t

You will have to build the body of the email using html tags to use color.

I am not familiar with HTML tags. can anyone provide the sample please?

The new way: <span style='color: blue;'>Hello</span>
The old way: <font color="blue">Hello</font>
The new way is preferred, but some old email clients might want the old way.

1 Like

Thank you Corona688
That worked. but after little tweak. separated failures and Success in 2 different files and added <br> tag in the failure file that will highlight the failures first in the report.

1 Like