Đặt danh mục màu cho tin nhắn Outlook

Aspose.Email - Đặt Danh mục Màu cho Tin nhắn Outlook

Microsoft Outlook cho phép người dùng gán các danh mục màu để phân biệt email. Một danh mục màu đánh dấu email có một mức độ quan trọng hoặc loại nào đó. Aspose.Email cung cấp tính năng tương tự qua FollowUpManager lớp. Các chức năng sau được hỗ trợ qua lớp này:

  • AddCategory() nhận MapiMessage và chuỗi danh mục màu làm đối số.
  • removeCategory() nhận MapiMessage và chuỗi danh mục màu cần xóa khỏi tin nhắn làm đối số.
  • clearCategories() được dùng để xóa tất cả các danh mục màu khỏi tin nhắn.
  • getCategories() được dùng để lấy tất cả các danh mục màu từ một tin nhắn cụ thể.

Java


 MapiMessage msg = MapiMessage.fromFile(dataDir + "message.msg");

// Add category

FollowUpManager.addCategory(msg, "Purple Category");

// Add another category

FollowUpManager.addCategory(msg, "Red Category");

// Retrieve the list of available categories

IList categories = FollowUpManager.getCategories(msg);

// Remove the specified category

FollowUpManager.removeCategory(msg, "Red Category");

// Clear all categories

//FollowUpManager.clearCategories(msg);

msg.save(dataDir + "AsposeCategories.msg");

Tải mã đang chạy

Tải mã mẫu