MimePartIsComplete Property |
Namespace: MailBee.Mime
If the message was received partially, this property may return false for some MIME parts of the message.
MailBee tests if the MIME part is complete by checking if the closing boundary was found. This, however, works for multi-part messages only. If the message consists of a single part and does not include any boundaries, it's not possible to determine if the part was received completely. However, in this case you can check MailMessage.SizeOnServer property. If its value is larger than MailMessage.Size, the message was incompletely received from the mail server.
// 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"); bool allPartsAreComplete = true; foreach (MimePart part in msg.MimePartTree.GetAllParts()) { if (!part.IsComplete) { allPartsAreComplete = false; break; } } if (allPartsAreComplete) { Console.WriteLine("allPartsAreComplete == true"); } else { Console.WriteLine("allPartsAreComplete == false"); }