简体   繁体   English

如何用蓝色邮寄邮件正文文本| Linux | Linux

[英]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 但是我希望将邮件发送到我的电子邮件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" 在上面的代码中,您可以看到名为$ _msg和“ _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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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