Bold characters in mail

I sh,
I have bold characters in a file and I want to mail file to an ID.

$cat file
Incorrect or invalid external email IDs in TO and CC list for email_rules:

If I pass this file to mailx
$ cat file | mailx -s "hi" abc@xyz.com

What I get in mail is
e[1mIncorrect or invalid external email IDs in TO and CC list for email_rules:e[0m

I want to preserve these bold characeters.
Can someone help?

The mail command cannot determine what the bold characters mean. Maybe you should send an email with the html bold signs.

But <Ctrl V> is not understool by the unix file.
Here mail command is taking input from a file.

What does ctrl v have to do with anything?

can you please let me know how are you suggesting to use html tags?

Like:

Content-Type: text/html
<b>TEXT</b>

Might be other header info you have to pass I didnt test it.

Sorry, I didnt get you. Do you want to print "<b>TEXT</b>" in the file?
Please note body of the mail is inputted from a file.

Dunno I got it to work with sendmail but not mailx or mail commands. Might have to play around with settings.

I also found these threads:

Well you will have to replace the bash bold statements with ones that are html based.

After altering the mail to html format you can use the sendmail command to send the email because I dont think mailx can interpret the html.

As per RFC822 (updated by RFC2822 and RFC5322) mail messages are text-only. If you want to send any form of binary data (which includes text enriched with formatting sequences) you will have to rely on the MIME format laid out in RFC2045, RFC2046 and RFC2049. Declare your message "multipart/mixed" in the MIME header in this case and read the RFCs to understand the requirements.

Otherwise and if you want to adhere to classic RFC822-formatting use "uuencode" (man uuencode) your text and send it this way. The receiving party can use "uudecode" (man uudecode) to retrieve the original file from there. In fact this is what uuencode/uudecode have been designed for.

I hope this helps.

bakunin