Mathias Colpaert
Mathias Colpaert

Reputation: 680

c# provide highlighted text to outlook html mail message

I am providing following HTML text to outlook :

<span style="background-color:yellow;">test</span>

I am providing this with Interop:

mailItem.To = ...;
mailItem.Subject = ...;
mailItem.HTMLBody = result.Data.Content;

However, in Outlook, I can not remove the the highlight.

enter image description here

How to format the HTML so Outlook will recognize it as a 'highlighted' text?

Upvotes: 1

Views: 1118

Answers (1)

Brian from state farm
Brian from state farm

Reputation: 2896

Try changing your span to:

<span style='background:yellow;mso-highlight:yellow'>

It looks like Microsoft has some specialized attributes.

Upvotes: 2

Related Questions