Java
Chilkat2 Java
IMAP NOOP Command
Demonstrates how to send an IMAP NOOP command using SendRawCommand.Chilkat Java Downloads
import com.chilkatsoft.chilkat2.ChilkatException;
import com.chilkatsoft.chilkat2.Imap;
public class ChilkatExample {
public static void main(String[] args) {
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
Imap imap = new Imap();
// Connect to an IMAP server.
// Use TLS
imap.setSsl(true);
imap.setPort(993);
try {
imap.connect("imap.example.com");
// Login
imap.login("****", "****");
} catch (ChilkatException e) {
System.out.println(e.getLastErrorText());
return;
}
// Send a NOOP command
String resp = imap.sendRawCommand("NOOP");
System.out.println(resp);
// Disconnect from the IMAP server.
imap.disconnect();
}
}