Color not showing in output text when sent via email


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Color not showing in output text when sent via email
# 1  
Old 08-06-2017
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:
Code:
/devm/MyScripts/testone.sh 2>&1 | tee -a -i out.txt | mailx -s "testing color" abc@xyz.com

Output from Outlook Mail:
Code:
 [1;31m This is red text  [0m

From command line

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

Contents of script:
Code:
\e[1;31m This is red text \e[0m

Thanks
# 2  
Old 08-06-2017
Follow the directions jgt gives in this post:
Add color to part of the text in a mail sent from unix script

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.
This User Gave Thanks to jim mcnamara For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Change the field color based on condition in email

Request your help to change the field color based on condition , if it is otherthan 0. using html in unix. Here is my condition for(i=1;i<=NF;i++) { print "<td> "$i"</td> } Please use CODE tags when displaying sample input, output, and code segments. (17 Replies)
Discussion started by: CatchMe
17 Replies

2. UNIX for Dummies Questions & Answers

Script output in Email is not showing Colored headers

Hi All I am working on AIX 7.1 and I am trying to show an output that I get from "cat" a log file to email. However in email I get the below output: In the script I have defined the colors as: #!/bin/sh echo "\033 Below is the script I have created to send this output: ... (9 Replies)
Discussion started by: Bubs
9 Replies

3. UNIX for Dummies Questions & Answers

Command showing no output!

Hi Folks, I have a situation here, where no command is giving any output, and it's not even showing any error message also. What could be the reason? (3 Replies)
Discussion started by: nixhead
3 Replies

4. Shell Programming and Scripting

Now showing the correct output

Hello I am working on one script where I am trying to display all the directories which is inside the workspace but somehow it is giving me weird output and this is occurring only with one directory other also having the result.html file inside the directory. for i in `ls -1 | egrep -iv... (2 Replies)
Discussion started by: anuragpgtgerman
2 Replies

5. Shell Programming and Scripting

Identify Color and send email with same color

Hello mates, I have a requirement where in which I have to mail an output from multiple programs in the same colour as the output from shell script. I have seen a post to mail html in our forum,but my case is I have to first identify which colour the output is in an then mail it to in the ... (10 Replies)
Discussion started by: Kingcobra
10 Replies

6. Shell Programming and Scripting

How to change the color inside email using shell script?

hi, i want to send an email from unix using mailx command. mailx -s "subject" "email@abc.com" < email.txt Email.txt contains some file names that are transferred successfully and some that failed. so the files that got failed to tranfer, should be displayed in red color in the mail. is it... (1 Reply)
Discussion started by: Little
1 Replies

7. Shell Programming and Scripting

.bashrc/PS1 command color different color to command output

I have been configuring my .bashrc PS1 to be displayed with some nice colors and in a format that I like, however there is one thing that I cannot figure out (or know if it's even possible). my PS1 line is as follows: export PS1='\\u\@\\h\:\\w\n\\$ \'This makes the command and command output... (0 Replies)
Discussion started by: jelloir
0 Replies
Login or Register to Ask a Question