Pop3QuickDownloadMessages Method (String, String, String, Int32)
Downloads all the messages (entire messages or message headers only) in the inbox on the server, in a single line of code.

Namespace: MailBee.Pop3Mail
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.2.0 build 630 for .NET 4.5
public static MailMessageCollection QuickDownloadMessages(
	string serverName,
	string accountName,
	string password,
	int bodyLineCount


Type: SystemString
The name or IP address of the POP3 server.
Type: SystemString
The user account name on the server.
Type: SystemString
The password of the user account on the server.
Type: SystemInt32
Number of lines of a message source body to download in addition to a message source header, or -1 to download entire messages, or 0 to download message headers only.

Return Value

Type: MailMessageCollection
A MailMessageCollection object containing the downloaded messages.
MailBeeExceptionAn 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 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).

This sample downloads headers of all the messages in the inbox, and displays indices (ordinal positions in the inbox) of all messages which likely have any attachments.
// 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");
See Also