(Unicode C) IMAP NOOP Command
Demonstrates how to send an IMAP NOOP command using SendRawCommand.
#include <C_CkImapW.h>
void ChilkatSample(void)
{
HCkImapW imap;
BOOL success;
const wchar_t *resp;
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
imap = CkImapW_Create();
// Connect to an IMAP server.
// Use TLS
CkImapW_putSsl(imap,TRUE);
CkImapW_putPort(imap,993);
success = CkImapW_Connect(imap,L"imap.someMailServer.com");
if (success != TRUE) {
wprintf(L"%s\n",CkImapW_lastErrorText(imap));
CkImapW_Dispose(imap);
return;
}
// Login
success = CkImapW_Login(imap,L"****",L"****");
if (success != TRUE) {
wprintf(L"%s\n",CkImapW_lastErrorText(imap));
CkImapW_Dispose(imap);
return;
}
// Send a NOOP command
resp = CkImapW_sendRawCommand(imap,L"NOOP");
wprintf(L"%s\n",resp);
// Disconnect from the IMAP server.
success = CkImapW_Disconnect(imap);
CkImapW_Dispose(imap);
}
|