Sample code for 30+ languages & platforms
Objective-C

IMAP NOOP Command

Demonstrates how to send an IMAP NOOP command using SendRawCommand.

Chilkat Objective-C Downloads

Objective-C
#import <CkoImap.h>
#import <NSString.h>

BOOL success = NO;

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

CkoImap *imap = [[CkoImap alloc] init];

//  Connect to an IMAP server.
//  Use TLS
imap.Ssl = YES;
imap.Port = [NSNumber numberWithInt:993];
success = [imap Connect: @"imap.example.com"];
if (success != YES) {
    NSLog(@"%@",imap.LastErrorText);
    return;
}

//  Login
success = [imap Login: @"****" password: @"****"];
if (success != YES) {
    NSLog(@"%@",imap.LastErrorText);
    return;
}

//  Send a NOOP command
NSString *resp = [imap SendRawCommand: @"NOOP"];
NSLog(@"%@",resp);

//  Disconnect from the IMAP server.
success = [imap Disconnect];