Sample code for 30+ languages & platforms
PowerShell

IMAP NOOP Command

Demonstrates how to send an IMAP NOOP command using SendRawCommand.

Chilkat PowerShell Downloads

PowerShell
Add-Type -Path "C:\chilkat\ChilkatDotNet47-x64\ChilkatDotNet47.dll"

$success = $false

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

$imap = New-Object Chilkat.Imap

# Connect to an IMAP server.
# Use TLS
$imap.Ssl = $true
$imap.Port = 993
$success = $imap.Connect("imap.example.com")
if ($success -ne $true) {
    $($imap.LastErrorText)
    exit
}

# Login
$success = $imap.Login("****","****")
if ($success -ne $true) {
    $($imap.LastErrorText)
    exit
}

# Send a NOOP command
$resp = $imap.SendRawCommand("NOOP")
$($resp)

# Disconnect from the IMAP server.
$success = $imap.Disconnect()