Sample code for 30+ languages & platforms
React Native

IMAP NOOP Command

Demonstrates how to send an IMAP NOOP command using SendRawCommand.

Chilkat React Native Downloads

React Native
import { Imap } from '@chilkat/react-native'

async function chilkatExample() {
  // This example assumes the Chilkat API to have been previously unlocked.
  // See Global Unlock Sample for sample code.

  const imap = new Imap();

  // Connect to an IMAP server.
  // Use TLS
  imap.ssl = true;
  imap.port = 993;
  try {
    await imap.connectAsync('imap.example.com');
  } catch {
    console.log(imap.lastErrorText);
    return;
  }

  // Login
  try {
    await imap.loginAsync('****', '****');
  } catch {
    console.log(imap.lastErrorText);
    return;
  }

  // Send a NOOP command
  const resp = await imap.sendRawCommandAsync('NOOP');
  console.log(resp);

  // Disconnect from the IMAP server.
  await imap.disconnectAsync();
}