Vuk Stanojevic

Vuk Stanojevic

  • 1.6k
  • 140
  • 45k

C# email body displays as HTML

Apr 5 2020 12:21 PM
Hi everyone,
I create email app.
In listview i display date,from,Message(body).
I have a problem that message body displays as HTML code.
How i can convert it to normal text?
I try with HtmlDecode but it didn't solve my problem.
 
EmailMessage message = EmailMessage.Bind(Service,item.Id);
string date = message.DateTimeReceived.ToString();
string from = message.From.Name.ToString();
string body = message.Body.Text.ToString();
ListViewItem item1 = new ListViewItem();
item1.SubItems.Add(date);
item1.SubItems.Add(from);
item1.SubItems.Add(body);
listView1.Items.Add(item1);

Answers (2)