Sample code for 30+ languages & platforms
JavaScript

IMAP NOOP Command

Demonstrates how to send an IMAP NOOP command using SendRawCommand.
Note
This example is intended for running within a Chilkat.Js embedded JavaScript engine. All Chilkat JavaScript examples require Chilkat v11.4.0 or greater.
JavaScript
var success = false;

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

var imap = new CkImap();

// Connect to an IMAP server.
// Use TLS
imap.Ssl = true;
imap.Port = 993;
success = imap.Connect("imap.example.com");
if (success !== true) {
    console.log(imap.LastErrorText);
    return;
}

// Login
success = imap.Login("****","****");
if (success !== true) {
    console.log(imap.LastErrorText);
    return;
}

// Send a NOOP command
var resp = imap.SendRawCommand("NOOP");
console.log(resp);

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