Rebex

Skip to content, Skip to navigation




Rebex Mail for .NET Features - POP3

POP3 is a protocol for retrieving mail from a mailbox on a remote server. It is a simple protocol that does not provide any advanced mail or folder management capabilities - these are offered by IMAP, and an IMAP component is a part of Rebex Mail for .NET as well.

Major features

  • Download mail as an instance of MailMessage or MimeMessage.
  • Download mail to a disk file or stream.
  • Download message headers without the body.
  • Retrieve message list filled with the specified info, such as size, sequence number, unique ID or headers.
  • Automatically detects and uses supported POP3 extensions.
  • Both synchronous and asynchronous operations. Designed according to .NET Framework asynchronous operations design patterns.
  • Authentication to the POP3 server.
  • Events can raised when command is sent, response is receiving or data is transferred.
  • Custom commands and enhanced status codes.
  • Proxy support.
  • Compatible with both state-of-the-art and legacy POP3 servers.
  • Compliant with RFC 1939, 2449, 1734, 1321, 2195, etc.

Supported authentication methods

  • Auto - automatically choose the best method available.
  • Plain - RFC 2595 plaintext authentication.
  • NTLM - Integrated Microsoft Windows Authentication.
  • SPNEGO/Negotiate (GSSAPI) - Integrated Microsoft Windows Authentication.
  • Digest-MD5 - RFC 2831 DIGEST-MD5 authentication.
  • CRAM-MD5 - RFC 2195 CRAM-MD5 authentication.
  • Login - 'LOGIN' plaintext authentication.
  • ClearText - Legacy plaintext USER/PASS login.
  • APOP - POP3-specific challenge-response authentication.

Sample usage

This sample demonstrates checking for a new mail in a POP3 mailbox.

C#

using Rebex.Net;
...

Pop3 client = new Pop3();
client.Connect("pop3.example.org");
client.Login("username", "password");

if (myPop3.GetMessageCount() > 0)
    MessageBox.Show("You have mail!");

VB.NET

Imports Rebex.Net
...

Dim client As New Pop3
client.Connect("pop3.example.org")
client.Login("username", "password")

If myPop3.GetMessageCount() > 0 Then 
    MessageBox.Show("You have mail!")
End If