Gets the collection of all immediate sub-parts of the MIME part.
A reference to the collection of all immediate sub-parts of the MIME part, or a null reference (Nothing in Visual Basic) if this MIME part is not multi-part.
This property contains the collection of immediate sub-parts of the MIME part. To get the MIME part and all its sub-parts (including sub-sub-parts) as a flat list, use GetAllParts method.
This sample loads the message from .EML file and displays the content type of each MIME part of the message.
[C#] // To use the code below, import MailBee namespaces at the top of your code. using MailBee; using MailBee.Mime; // The actual code (put it into a method of your class). MailMessage msg = new MailMessage(); msg.LoadMessage(@"C:\Docs\TestMail.eml"); if (msg.MimePartTree.SubParts != null) { foreach (MimePart part in msg.MimePartTree.SubParts) { Console.WriteLine(part.ContentType.ToString()); } }
[Visual Basic] ' To use the code below, import MailBee namespaces at the top of your code. Imports MailBee Imports MailBee.Mime ' The actual code (put it into a method of your class). Dim msg As New MailMessage msg.LoadMessage("C:\Docs\TestMail.eml") If Not msg.MimePartTree.SubParts Is Nothing Then For Each part As MimePart In msg.MimePartTree.SubParts Console.WriteLine(part.ContentType.ToString()) Next End If
MimePart Class | MailBee.Mime Namespace