I am trying to extract the readable portion of the Body.Text property of a TIDMessagePart object that is type TIDText. Something like the code below. However if ContentType of the TIDText message part is not text/plain, but is rather text/html, this fills sBody with all the HTML tags. I just want the readable text, but don't see a way to get that in the version 9 library. Am I missing something?
var email: TIDMessage; sBody: String;
...
for j := 0 to Pred(email.MessageParts.Count) do
begin
if email.MessageParts.Items[j] is TIdText then
begin
sBody := TIdText(email.MessageParts.Items[j]).Body.Text;
end;
end;