使用 Pop3Client 列出服务器扩展

Aspose.Email Pop3Client 让您检索服务器支持的扩展,例如 IDLE、UNSELECT、QUOTA 等。这有助于在使用客户端的特定功能之前识别扩展的可用性。该 getCapabilities() 方法以字符串数组的形式返回支持的扩展类型。

检索服务器扩展

以下代码示例演示了使用 Pop3Client 检索 Gmail 服务器的服务器扩展。

// For complete examples and data files, please go to https://github.com/aspose-email/Aspose.Email-for-Java

// Connect and log in to POP3
Pop3Client client = new Pop3Client("pop.gmail.com", "username", "password");
client.setSecurityOptions(SecurityOptions.Auto);
client.setPort(995);
String[] getCaps = client.getCapabilities();
for (String item : getCaps) {
    System.out.println(item);
}