翻譯|使用教程|編輯:胡濤|2022-04-13 14:27:59.593|閱讀 194 次
概述:本文介紹了如何創造一種分發清單是女士交換服務器在爪哇. 此外,它還展示了如何以編程方式獲取分發列表
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關鏈接:
MS Exchange Server允許您創建電子郵件分發列表,該列表可用于向一群人發送電子郵件,而無需輸入個人電子郵件地址。到創造以編程方式列出此類列表,本文介紹了如何創造一種分發清單是女士交換服務器在爪哇. 此外,它還展示了如何以編程方式獲取分發列表。
要在 MS Exchange Server 上創建分發列表,我們將使用Aspose.Email for Java。該 API 旨在從 Java 應用程序中創建、發送和處理電子郵件。此外,它還支持在不編寫復雜代碼的情況下使用 MS Outlook 和 Exchange Server。您可以 下載 API 或使用以下 Maven 配置安裝它。
Repository:
<repository> <id>AsposeJavaAPI</id> <name>Aspose Java API</name> <url>//repository.aspose.com/repo/</url> </repository>
Dependency:
<dependency> <groupId>com.aspose</groupId> <artifactId>aspose-email</artifactId> <version>22.3</version> <classifier>jdk16</classifier> </dependency>
以下是使用 Java 在 MS Exchange Server 上創建分發列表的步驟。
以下代碼示例顯示了如何在 Java 中創建 MS Exchange 通訊組列表。
// Connect to Exchange Server IEWSClient client = EWSClient.getEWSClient("http://outlook.office365.com/ews/exchange.asmx", "testUser", "pwd", "domain"); // Instantiate list ExchangeDistributionList distributionList = new ExchangeDistributionList(); // Set display name distributionList.setDisplayName("test private list"); // Add members to list MailAddressCollection members = new MailAddressCollection(); members.add("address1@host.com"); members.add("address2@host.com"); members.add("address3@host.com"); // Create list client.createDistributionList(distributionList, members);
現在,讓我們看看如何在 Java 中以編程方式從 MS Exchange Server 獲取分發列表。
以下代碼示例顯示了如何從 Java 中的 MS Exchange Server 獲取分發列表。
// Connect to Exchange Server IEWSClient client = EWSClient.getEWSClient("http://outlook.office365.com/ews/exchange.asmx", "testUser", "pwd", "domain"); // Get all lists ExchangeDistributionList[] distributionLists = client.listDistributionLists(); // Loop through each list and fetch members for (ExchangeDistributionList distributionList : distributionLists) { MailAddressCollection members = client.fetchDistributionList(distributionList); for (MailAddress member : (Iterable<MailAddress>) members) { System.out.println(member.getAddress()); } }
在本文中,您學習了如何使用 Java 在 MS Exchange Server 上創建分發列表。此外,您還了解了如何以編程方式獲取 MS Exchange 分發列表。此外,您可以瀏覽 文檔以閱讀有關 Aspose.Email for Java 的更多信息。此外,您可以通過在線客服或加入群聊提出您的問題。
歡迎下載|體驗更多Aspose產品
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn