aspNetIMAP

SilentOption Enumeration

.onRequests an untagged FETCH response from the IMAP server.

publicenumSilentOption

Remarks

Normally when a client makes a request to the server, and the message's flags are changed, the server responds with the new flags. If SilentOption.On is used, the client is expected to know what the flag changes are, and thus the server does not send them back to the client, thereby decreasing network traffic.

Example

          [C#]
IMAP4 imap = new IMAP4( "127.0.0.1" );
 
imap.Username = "dave@blah.com";
imap.Password = "test";
imap.Login();
 
//grab the inbox
MailFolder mf = imap.SelectInbox();
 
MessageClient mc = mf.MessageClient;
 
//set various flags
string flags = Flag.ConvertToString( FlagTypes.Answered, FlagTypes.Seen );
 
//get the flag collection with SilentOption.Off
FlagCollection fc = mc.Mark( 1, flags, IndexType.Ordinal,  SilentOption.Off );
 
foreach( Flag f in fc )
{
    Console.WriteLine( f.Value );
}
 
//now make the same call with SilentOption.On
fc = mc.Mark( 1, flags, IndexType.Ordinal,  SilentOption.On);
 
//no flags will be output, because SilentOption.On
foreach( Flag f in fc )
{
    Console.WriteLine( f.Value );
}
 
imap.Disconnect();
 
Console.WriteLine( "Done" );
Console.ReadLine();
    
          [VB.NET]
Dim imap As New IMAP4("127.0.0.1")
 
imap.Username = "dave@blah.com"
imap.Password = "test"
imap.Login()
 
'grab the inbox
Dim mf As MailFolder = imap.SelectInbox()
 
Dim mc As MessageClient = mf.MessageClient
 
'set various flags
Dim flags As String = Flag.ConvertToString(FlagTypes.Answered, FlagTypes.Seen)
 
'get the flag collection with SilentOption.Off
Dim fc As FlagCollection = mc.Mark(1, flags, IndexType.Ordinal, SilentOption.Off)
 
Dim f As Flag
For Each f In  fc
   Console.WriteLine(f.Value)
Next f
 
'now make the same call with SilentOption.On
fc = mc.Mark(1, flags, IndexType.Ordinal, SilentOption.On)
 
'no flags will be output, because SilentOption.On
Dim f As Flag
For Each f In  fc
   Console.WriteLine(f.Value)
Next f
 
imap.Disconnect()
 
Console.WriteLine("Done")
Console.ReadLine()
    

Members

Member Name Description
OffThe message flags are returned to the client.
On Any changes to the message flags are NOT returned to the client. The client is expected to know the new/changed flags on the message.

Requirements

Namespace: aspNetIMAP

Assembly: aspNetIMAP (in aspNetIMAP.dll)

See Also

aspNetIMAP Namespace