Rebex

Skip to content, Skip to navigation




Rebex Secure Mail for .NET Features - IMAP

IMAP is a powerful protocol for managmenent of e-mail stored on a remote server. It has support for a tree-like folder structure, message flags, searching and message uploading as well as downloading. IMAP is supported by most mail servers either out-of-the-box or through a supporting service.

Message management features

  • Download mail as an instance of MailMessage or MimeMessage.
  • Download mail to a disk file or stream.
  • Download message headers without the body.
  • Upload a simple message using a single line of code.
  • Upload mail from a disk file or stream.
  • Upload any MailMessage or MimeMessage instance (arbitrary number of body views, attachments, ...)
  • Retrieve message list filled with the specified info, such as size, sequence number, received date, flags, unique ID, message plain/HTML bodies, common headers or full headers.
  • Delete messages.
  • Copy messages.
  • Mark/unmark message flags such as seen/unseen, answered/unanswered, draft, or flagged.
  • Multiple message operations - copy, delete, or set flags for a range of messages in a single operation.
  • IMAP over TLS/SSL, both implicit and explicit security.

Folder management features

  • Create folders.
  • Rename folders.
  • Delete folders.
  • Subscribe and Unsubscribe folders.
  • Select and unselect folders.

More features

  • Powerful message searching capabilities - search for text, flags, and more.
  • Automatically detects and uses supported IMAP extensions.
  • Both synchronous and asynchronous operations. Designed according to .NET Framework asynchronous operations design patterns.
  • Authentication to the IMAP server.
  • Events can raised when command is sent, response is receiving or data is transferred.
  • Events can be raised when a notification message is received from the server.
  • Custom commands.
  • Proxy support.
  • Compatible with both state-of-the-art IMAP4rev1 and legacy IMAP4 servers.
  • Compliant with RFC 3501, 2683, 2359, 1321, etc.

Supported authentication methods

  • Auto - automatically choose the best method available.
  • Plain - RFC 2595 plaintext authentication.
  • NTLM - Microsoft's Integrated Windows Authentication.
  • Digest-MD5 - RFC 2831 DIGEST-MD5 authentication.
  • CRAM-MD5 - RFC 2195 CRAM-MD5 authentication.
  • Login - 'LOGIN' plaintext authentication.
  • ClearText - Legacy plaintext LOGIN command.

Sample usage

This sample demonstrates checking for new mail in an IMAP folder.

C#

using Rebex.Net;
...

Imap client = new Imap();
client.Connect("imap.example.org");
client.Login("username", "password");

client.SelectFolder("Inbox");

if (client.CurrentFolder.RecentMessageCount > 0)
    MessageBox.Show("You have new mail in your inbox!");

VB.NET

Imports Rebex.Net
...

Dim client As New Imap
client.Connect("imap.example.org")
client.Login("username", "password")

client.SelectFolder("Inbox")

If client.CurrentFolder.RecentMessageCount > 0 Then 
    MessageBox.Show("You have new mail in your inbox!")
End If