ImapEnvelopeDownloadedEventArgsDownloadedEnvelope Property
Gets or sets the envelope which had been downloaded.

Namespace: MailBee.ImapMail
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 11.2.0 build 590 for .NET 4.5
public Envelope DownloadedEnvelope { get; set; }

Property Value

Type: Envelope
A reference to the mail message envelope which had been just downloaded, or a null reference (Nothing in Visual Basic) if there had been no message data in the server response.

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.

See Also