Pop3MessageDownloadedEventArgsDownloadedMessage Property |
Namespace: MailBee.Pop3Mail
When this property value is a null reference, this usually means the mail server replied with a negative response instead of a message data. For instance, this may happen on attempt to download a messsage which had already been marked as deleted during the current POP3 session. In this case, the corresponding method of Pop3 class which had been used to download message(s) will throw an exception after the method has finished receiving data from the POP3 server.
The developer can also manually set this property value to a null reference to avoid inclusion of this message into the resulting MailMessageCollection. For methods returning a single message (such as DownloadEntireMessage(Int32)), 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 MessageDownloaded event handler and then set DownloadedMessage to a null reference to free the resources. This is efficient and memory conservative appoach.