Font Editing to be done in shell script

Hi,
Iam writing a script in unix shell and need to edit the output (With colors and bold/italic/underline) and send as email. Can someone please help me on this requirement

Output as below. Need to know how to set this in echo command

Message Flow: messageflow1 //need to put this in red color
Execution Group: EG_mail2 //need to make this line bold font
Status: STOPPED

Code

echo "Message Flow:    $brokerflow" >> stoppedflow.txt
  echo "Execution Group: $eg" >> stoppedflow.txt
  echo "Status: STOPPED" >> stoppedflow.txt
mail -s "`hostname` Alert!! Broker message flow is stopped" sample@xxx.com < stoppedflow.txt

That highly depends on the capabilities of the receiving side. Will the mail be read using a mail client that understands/interprets HMTL text? Or just on a terminal capable of interpreting ECMA-48/ISO 6429/ANSI X3.64 terminal controls?

Hi RudiC,
Outlook 2013 is the mail client which is the receiving system

Thanks.

Well, I don't know anything about Outlook 2013. Does it accept HTML mails?

Yes RudiC

Try this very simplified version

printf "<html><body>\n<font color=\"#ff0000\">Message Flow: %s</font><br><b>Execution Group: %s</b><br>Status: STOPPED\n</body></html>\n" $brokerflow $EG > stoppedflow.txt

It might happe that outlook reckognized the txt extension and doesnt do html parsing on it.
Unless you only send the content of stoppedflow.txt, and not the whole file.

hth

You'll have to add the appropriate mime header information. Without it no mail client I know of will treat the mail as html. Check if your mailx implementation supports the -a extension.

printf "<html><body>\n<font color=\"#ff0000\">Message Flow: %s</font><br><b>Execution Group: %s</b><br>Status: STOPPED\n</body></html>\n" $brokerflow $EG | \
mail -a "Content-Type: text/html" -s "`hostname` Alert!! Broker message flow is stopped" sample@xxx.com