MimePartSubParts Property |
Gets the collection of all immediate sub-parts of the MIME part.
Namespace: MailBee.MimeAssembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax public MimePartCollection SubParts { get; }
Public ReadOnly Property SubParts As MimePartCollection
Get
Property Value
Type:
MimePartCollection
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.
Remarks
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.
Examples This sample loads the message from .EML file and displays the content type of each MIME part of the message.
using MailBee;
using MailBee.Mime;
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());
}
}
Imports MailBee
Imports MailBee.Mime
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
See Also