MailMessageAppendPartialMessage Method
Adds the specified partial message to this message.

Namespace: MailBee.Mime
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 11.2.0 build 590 for .NET 4.5
public bool AppendPartialMessage(
	MailMessage nextPart


Type: MailBee.MimeMailMessage
A portion of the message as another MailMessage object.

Return Value

Type: Boolean
true if the partial message which was appended was the last one required; otherwise, false.
MailBeeInvalidArgumentExceptionnextPart is a null reference (Nothing in Visual Basic) or not a partial message.
MailBeeInvalidStateExceptionThe message is not partial, so another partial message can't be added to it.

Some mail client programs can split large messages into a number of smaller messages before sending and then send these smaller e-mails separately. This technique was used to overcome limitations of maximum size of a message which existed on some mail servers. Nowadays, this practice is not used but MailBee is still capable of parsing such messages. To assembly a message from its parts (they have message/partial in their ContentType), you should get the first part (having PartIndex set to 1), and append the remaining messages in the correct order (with PartIndex set to 2, 3, etc) using AppendPartialMessage(MailMessage) until it returns true. AppendPartialMessage(MailMessage) returns true when you append a message having PartIndex equal to PartCount.

Use PartCount property to determine if the mail message is split (and so it's needed to get the remaining parts and join them with AppendPartialMessage(MailMessage) method).

Use PartIndex property to obtain the index of the message so that you would be able to pass the messages to be appended by AppendPartialMessage(MailMessage) method in proper order (from 1 to PartCount).

This sample assemblies the message from 4 partial messages. It loads the first portion and then calls AppendPartialMessage(MailMessage) for the remaining 3 portions.
using MailBee;
using MailBee.Mime;

class Sample
    static void Main(string[] args)
        MailMessage newMsg = new MailMessage();
        MailMessage partialMsg = new MailMessage();

        // Append 3 partial messages that are loaded from disk.
        for (int i = 2; i <= 4; i++)
            partialMsg.LoadMessage(string.Format(@"C:\Docs\splitmail\{0}of4.eml", i));

        // Save the entire message to disk.
See Also