Pop3QuickDownloadMessages Method (String, String, String, Int32) |
Namespace: MailBee.Pop3Mail
public static MailMessageCollection QuickDownloadMessages( string serverName, string accountName, string password, int bodyLineCount )
Exception | Condition |
---|---|
MailBeeException | An error occurred. |
This method does not delete any messages in the inbox.
If the POP3 server supports pipelining, this method will download all the messages in a single network operation, which greatly increases performance and reduces network traffic.
Note |
---|
Static methods still require the valid license key be assigned to MailBee.Global.LicenseKey property (by either setting in in the code or in the config file such as app.config). All samples in MailBee documentation assume the license key is already set in the config file. |
This method is not async, it's recommended (and in case of UWP platform it's mandatory) to use sync methods like DownloadMessageHeadersAsync(Int32, Int32, Int32).
// To use the code below, import MailBee namespaces at the top of your code. using MailBee; using MailBee.Pop3Mail; using MailBee.Mime; // The actual code (put it into a method of your class). MailMessageCollection msgs = Pop3.QuickDownloadMessages("pop.server.com", "login", "password", 0); foreach (MailMessage msg in msgs) { if (msg.HasAttachments) { Console.WriteLine("Message #" + msg.IndexOnServer + " seems to have any attachments"); } }