Listing Server Extensions using 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);
}