翻譯|使用教程|編輯:胡濤|2022-04-13 14:27:59.593|閱讀 194 次
概述:本文介紹了如何創(chuàng)造一種分發(fā)清單是女士交換服務(wù)器在爪哇. 此外,它還展示了如何以編程方式獲取分發(fā)列表
# 界面/圖表報(bào)表/文檔/IDE等千款熱門(mén)軟控件火熱銷(xiāo)售中 >>
相關(guān)鏈接:
MS Exchange Server允許您創(chuàng)建電子郵件分發(fā)列表,該列表可用于向一群人發(fā)送電子郵件,而無(wú)需輸入個(gè)人電子郵件地址。到創(chuàng)造以編程方式列出此類(lèi)列表,本文介紹了如何創(chuàng)造一種分發(fā)清單是女士交換服務(wù)器在爪哇. 此外,它還展示了如何以編程方式獲取分發(fā)列表。
要在 MS Exchange Server 上創(chuàng)建分發(fā)列表,我們將使用Aspose.Email for Java。該 API 旨在從 Java 應(yīng)用程序中創(chuàng)建、發(fā)送和處理電子郵件。此外,它還支持在不編寫(xiě)復(fù)雜代碼的情況下使用 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 上創(chuàng)建分發(fā)列表的步驟。
以下代碼示例顯示了如何在 Java 中創(chuàng)建 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);
現(xiàn)在,讓我們看看如何在 Java 中以編程方式從 MS Exchange Server 獲取分發(fā)列表。
以下代碼示例顯示了如何從 Java 中的 MS Exchange Server 獲取分發(fā)列表。
// 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()); } }
在本文中,您學(xué)習(xí)了如何使用 Java 在 MS Exchange Server 上創(chuàng)建分發(fā)列表。此外,您還了解了如何以編程方式獲取 MS Exchange 分發(fā)列表。此外,您可以瀏覽 文檔以閱讀有關(guān) Aspose.Email for Java 的更多信息。此外,您可以通過(guò)在線客服或加入群聊提出您的問(wèn)題。
歡迎下載|體驗(yàn)更多Aspose產(chǎn)品
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請(qǐng)務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請(qǐng)郵件反饋至chenjj@fc6vip.cn