Sample code for 30+ languages & platforms
Unicode C++

IMAP NOOP Command

Demonstrates how to send an IMAP NOOP command using SendRawCommand.

Chilkat Unicode C++ Downloads

Unicode C++
#include <CkImapW.h>

void ChilkatSample(void)
    {
    bool success = false;

    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    CkImapW imap;

    // Connect to an IMAP server.
    // Use TLS
    imap.put_Ssl(true);
    imap.put_Port(993);
    success = imap.Connect(L"imap.example.com");
    if (success != true) {
        wprintf(L"%s\n",imap.lastErrorText());
        return;
    }

    // Login
    success = imap.Login(L"****",L"****");
    if (success != true) {
        wprintf(L"%s\n",imap.lastErrorText());
        return;
    }

    // Send a NOOP command
    const wchar_t *resp = imap.sendRawCommand(L"NOOP");
    wprintf(L"%s\n",resp);

    // Disconnect from the IMAP server.
    success = imap.Disconnect();
    }