How to convert outlook.mailitem HTML to normal HTML?

Prasad Gavande
1
Reputation point
I am developing outlook add-in, in which I want to monitor emails. Once email is received I want to further work on it.
I am using simple function to read email body as below.
void items_itemAdd(object item)
{
Outlook.MailItem mail = (Outlook.MailItem)item;
if (item != null)
{
string mailBody = mail.HTMLBody.ToString();
}
}
but when I run the code, it return html body (mail.HTMLBody) with unwanted tags. (please see attachment, apologize, I was not able to post html code here)
I want to remove all unwanted tags, CSS.
How can I convert outlook generated html to normal html ?
Hi @Jade Liang-MSFT ,
Thank you for correcting.