MailBee.NET Objects 4.0

MimePart.Boundary Property

Gets the string which delimits MIME parts nested into this part.

public string Boundary {get;}

Property Value

A string containing the delimiter separating MIME sub-parts of this part if. If this part is not multi-part, the return value is an empty string.

Remarks

If the MIME part is multi-part (has one or more MIME parts nested into it), these sub-parts should be separated with a unique delimiter string. This string is specified in boundary attribute of the Content-Type header of the part header section.

For instance, if the MIME part header is Content-type: multipart/mixed; boundary="Boundary_(ID_frk7dChObvUn0w8y7BE4uQ)", the Boundary property will return Boundary_(ID_frk7dChObvUn0w8y7BE4uQ) value.

Example

This sample loads the message from .EML file and displays the boundary used to delimit sub-root MIME parts of this message. If the message is not multi-part and consists of a root part only, the sample will print an empty line.

[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)

// Load the message from file.
MailMessage msg = new MailMessage();
msg.LoadMessage(@"C:\Docs\TestMail.eml");

// Show the boundary.
Console.WriteLine(msg.MimePartTree.Boundary);
[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)

' Load the message from file.
Dim msg As New MailMessage
msg.LoadMessage("C:\Docs\TestMail.eml")

' Show the boundary.
Console.WriteLine(msg.MimePartTree.Boundary)

See Also

MimePart Class | MailBee.Mime Namespace | MimePartCollection