| 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.| Exception | Description |
|---|---|
| Dart.PowerTCP.Mail.ProtocolException | Bad IMAP protocol response received from server. |
| System.Net.Sockets.SocketException | The requested address is not valid in its context. |
The following example demonstrates sending a NOOP command and checking the response.
| Visual Basic | Copy 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(); | |
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.
Target Platforms: Microsoft .NET Framework 2.0