Sample code for 30+ languages & platforms
Go

IMAP NOOP Command

Demonstrates how to send an IMAP NOOP command using SendRawCommand.

Chilkat Go Downloads

Go
    success := false

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

    imap := chilkat.NewImap()

    // Connect to an IMAP server.
    // Use TLS
    imap.SetSsl(true)
    imap.SetPort(993)
    success = imap.Connect("imap.example.com")
    if success != true {
        fmt.Println(imap.LastErrorText())
        imap.DisposeImap()
        return
    }

    // Login
    success = imap.Login("****","****")
    if success != true {
        fmt.Println(imap.LastErrorText())
        imap.DisposeImap()
        return
    }

    // Send a NOOP command
    resp := imap.SendRawCommand("NOOP")
    fmt.Println(*resp)

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

    imap.DisposeImap()