ImapEnvelopeDownloadedEventArgsDownloadedEnvelope Property |
Namespace: MailBee.ImapMail
When this property value is a null reference, this usually means the mail server replied with a response which could not be completely parsed (i.e. the mail server produces incorrect IMAP4 responses). In this case, the correspodning method of Imap class which had been used to download message(s) will throw an exception after the method has finished receiving data from the IMAP4 server.
The developer can also manually set this property value to a null reference to avoid inclusion of this envelope into the resulting EnvelopeCollection. For methods returning a single envelope (such as DownloadEntireMessage(Int64, Boolean)), the result will be a null reference.
Setting this property to a null reference is also useful for downloading very large number of messages at once (when they won't fit in memory). In this case, the developer can save each message to database/disk in EnvelopeDownloaded event handler and then set DownloadedEnvelope to a null reference to free the resources. This is efficient and memory conservative appoach.