Sample code for 30+ languages & platforms
Lua

IMAP NOOP Command

Demonstrates how to send an IMAP NOOP command using SendRawCommand.

Chilkat Lua Downloads

Lua
local chilkat = require("chilkat")

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

local imap = chilkat.Imap.new()

-- Connect to an IMAP server.
-- Use TLS
imap.ssl = true
imap.port = 993
local success = imap:connect("imap.example.com")
if not success then
    print(imap.last_error_text)
    return
end

-- Login
success = imap:login("****", "****")
if not success then
    print(imap.last_error_text)
    return
end

-- Send a NOOP command
local resp = imap:send_raw_command("NOOP")
print(resp)

-- Disconnect from the IMAP server.
success = imap:disconnect()