简体   繁体   中英

How to mail message body text in color Blue |Linux |

I have a scenario where The Code works perfectly

But I want some text should appear blue color when mail is sent to my email id

My Code :

export _From=abc@in.co
export _To=example@gmail.com
export _Subject=Remove files 
export _cp = '/demo/f1.txt'
export _msg = 'Classified: Student'

echo -e "\n $_msg  \n\n Hi Friends, \n\n Files Removed Successfully \n\n Note:- Auto-generated mail, please do not reply to this mail." | mailx -a $_cp -vvv -s "$_Subject" -r "$_From" $_To

In the above code you can see the parameter called $_msg and "_msg"

This message should appear in blue color when the above code is Run and mail is sent to me

您可以在现有脚本中进行以下更改,以将消息打印为蓝色。

echo -e '\033[01;36m' "\n $_msg  \n\n Hi Friends, \n\n Files Removed Successfully \n\n Note:- Auto-generated mail, please do not reply to this mail." | mailx -a $_cp -vvv -s "$_Subject" -r "$_From" $_To

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM