Connects to a POP3 server.
true if a connection attempt succeeded; otherwise, false.
If Pipelining is true and the server supports pipelining, MailBee will use it and join POP3 commands in batches whenever possible (see Connect overload for more information).
| Exception Type | Condition |
|---|---|
| MailBeeException | An error occurred and ThrowExceptions is true. |
This sample connects to the POP3 server, downloads the last message entirely, and displays filenames of all attachments.
[C#] // 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) Pop3 pop = new Pop3(); pop.Connect("mail.domain.com", 110); pop.Login("jdoe", "secret"); MailMessage msg = pop.DownloadEntireMessage(pop.InboxMessageCount); foreach (Attachment attach in msg.Attachments) { Console.WriteLine(attach.Filename); } pop.Disconnect();
[Visual Basic] ' To use the code below, import MailBee namespaces at the top of your code Imports MailBee Imports MailBee.Pop3Mail Imports MailBee.Mime ' The actual code (put it into a method of your class) Dim pop As New Pop3 pop.Connect("mail.domain.com", 110) pop.Login("jdoe", "secret") Dim msg As MailMessage msg = pop.DownloadEntireMessage(pop.InboxMessageCount) For Each attach As Attachment In msg.Attachments Console.WriteLine(attach.Filename) Next pop.Disconnect()
Pop3 Class | MailBee.Pop3Mail Namespace | Pop3.Connect Overload List