PowerTCP Mail for .NET
Noop Method
See Also  Example Send comments on this topic.
Dart.PowerTCP.Mail Namespace > Imap Class : Noop Method




Sends a NOOP command to keep the user logged in and to poll for changes.

Syntax

Visual Basic (Declaration) 
Public Function Noop() As ImapResponse
Visual Basic (Usage)Copy Code
Dim instance As Imap
Dim value As ImapResponse
 
value = instance.Noop()
C# 
public ImapResponse Noop()
Managed Extensions for C++ 
public: ImapResponse* Noop(); 
C++/CLI 
public:
ImapResponse^ Noop(); 

Return Value

An ImapResponse object representing the response from the server.

Exceptions

ExceptionDescription
Dart.PowerTCP.Mail.ProtocolExceptionBad IMAP protocol response received from server.
System.Net.Sockets.SocketExceptionThe requested address is not valid in its context.

Example

The following example demonstrates sending a NOOP command and checking the response.
Visual BasicCopy Code
' Login to the mail server
Imap1.Login(Server, User, Pass)

' Send a NOOP command
Dim Response As ImapResponse = Imap1.Noop()

' Check the response
If Response.Status = ImapStatus.Ok Then
   Debug.WriteLine("Good response from server")
Else
   Debug.WriteLine("Response from server: " + Response.Status)
End

' Logout
Imap1.Logout()
C#Copy Code
// Login to the mail server
imap1.Login(server, user, pass);

// Send a NOOP command
ImapResponse response = imap1.Noop();

// Check the response
if(response.Status == ImapStatus.Ok)
   Debug.WriteLine("Good response from server");
else
   Debug.WriteLine("Response from server: " + response.Status);

// Logout
imap1.Logout();

Remarks

The Imap.Noop method sends an IMAP NOOP command. The IMAP NOOP command allows the user to keep the connection with the server alive as well as poll for changes in the current mailbox with minimum impact on the server.

The IMAP IDLE command was implemented to provide a better way for the client to be notified of changes to the mailbox. See the Imap.Idle for a description of using this command.

Requirements

Target Platforms: Microsoft .NET Framework 2.0

See Also

Documentation Version 3.2
© 2010 Dart Communications. All Rights Reserved.