Подключение к серверу Exchange
Contents
[
Hide
]
Для подключения к серверам Exchange 2007, 2010 и 2013 с использованием Exchange Web Service класс Aspose.Email предоставляет EWSClient. Метод GetEWSClient создает и возвращает объект IEWSClient, который затем используется для выполнения операций, связанных с почтовым ящиком Exchange и другими папками. В этой статье показано, как создавать объекты IEWSClient.
Следующий код показывает, как подключиться с помощью Exchange Web Service (EWS).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-email/Aspose.Email-for-C | |
ExchangeTestUser exchangeUser = ExchangeTestUser(u"https://your.exchange.server/ews/Exchange.asmx", u"username", u"password"); | |
const System::String mailboxUri = exchangeUser.MailboxUri; | |
const System::String domain = exchangeUser.Domain; | |
const System::String username = exchangeUser.Name; | |
const System::String password = exchangeUser.Password; | |
System::SharedPtr<System::Net::NetworkCredential> credentials = System::MakeObject<System::Net::NetworkCredential>(username, password, domain); | |
System::SharedPtr<IEWSClient> client = EWSClient::GetEWSClient(mailboxUri, credentials); |