Color not showing in output text when sent via email

Hi,
I have a test script where I am trying to make a line color in RED. It works when I execute the command from command line but when I try to send the output of the script via mailx it will not show me the color and instead show this output:

Command to send script output to email:

/devm/MyScripts/testone.sh 2>&1 | tee -a -i out.txt | mailx -s "testing color" abc@xyz.com

Output from Outlook Mail:

 [1;31m This is red text  [0m

From command line

Server1:/devm/MyScripts # ./testone.sh
 This is red text

Contents of script:

\e[1;31m This is red text \e[0m

Thanks

Follow the directions jgt gives in this post:

This specifically deals with reading an email file with UNIX's mailx (sendmail front end). Windows requires HTML content to show colors in outlook, for example. Different email readers == different email content.

1 Like