(C) IMAP NOOP Command
Demonstrates how to send an IMAP NOOP command using SendRawCommand.
#include <C_CkImap.h>
void ChilkatSample(void)
{
HCkImap imap;
BOOL success;
const char *resp;
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
imap = CkImap_Create();
// Connect to an IMAP server.
// Use TLS
CkImap_putSsl(imap,TRUE);
CkImap_putPort(imap,993);
success = CkImap_Connect(imap,"imap.someMailServer.com");
if (success != TRUE) {
printf("%s\n",CkImap_lastErrorText(imap));
CkImap_Dispose(imap);
return;
}
// Login
success = CkImap_Login(imap,"****","****");
if (success != TRUE) {
printf("%s\n",CkImap_lastErrorText(imap));
CkImap_Dispose(imap);
return;
}
// Send a NOOP command
resp = CkImap_sendRawCommand(imap,"NOOP");
printf("%s\n",resp);
// Disconnect from the IMAP server.
success = CkImap_Disconnect(imap);
CkImap_Dispose(imap);
}
|