The event that is raised when a message has been deleted on the server.

Namespace: S22.Imap
Assembly: S22.Imap (in S22.Imap.dll) Version: 3.6.0.0 (3.6.0.0)

Syntax

C#
event EventHandler<IdleMessageEventArgs> MessageDeleted

Remarks

To probe a server for IMAP IDLE support, the Supports(String) method can be used, specifying "IDLE" for the capability parameter. Please note that the event handler will be executed on a threadpool thread.

Examples

This example demonstrates how to receive IMAP IDLE notifications.
CopyC#
ImapClient Client = new ImapClient("imap.gmail.com", 993, "My_UsernamMe",
    "My_Password", true, AuthMethod.Login);

// Make sure our server actually supports IMAP IDLE.
if(!Client.Supports("IDLE"))
    throw new Exception("This server does not support IMAP IDLE");

// Our event handler will be called whenever a message is deleted on the server.
Client.MessageDeleted += new EventHandler<IdleMessageEventArgs>(OnMessageDeleted);

// .........

// Don't forget to dispose the client once you're done with it.
Client.Dispose();

// ........

void OnMessageDeleted(object sender, IdleMessageEventArgs e) {
    Console.WriteLine("A mail message was deleted on the server!");
    Console.WriteLine("Total number of mail messages in the mailbox: " +
        e.MessageCount);
}

See Also