0 votes

I'm wondering ... the IMail.IsHtml and IMail.IsText properties, are they detected using an algorithm based on the content, or how?

by

1 Answer

0 votes
 
Best answer

Those properties check if IMail.TextData and IMail.HtmlData are not null.
Remember that mail may have both: html and plain text content at the same time.

The process is as follows:
When email is parsed from raw eml data received from POP3 or IMAP, first MIME tree is build and MimeDocument class is created.

Then it traversed recursively to find text/plain and text/html parts and set IMail.TextData and IMail.HtmlData.

This process is not a simple walk through all elements as email may contain attachments and visual elements so multipart/mixed, Multipart/alternative, multipart/related MIME entities must be processed accordingly.

by (301k points)
...