Connecting to Exchange Server
Contents
[
Hide
]
In order to connect to Exchange servers 2007, 2010 and 2013 using Exchange Web Service, Aspose.Email provides the EWSClient class. The GetEWSClient method instantiates and returns an IEWSClient object that is further used to perform operations related to an Exchange mailbox and other folders. This article shows how to instantiate objects of IEWSClient.
The following code snippet shows you how to connect using Exchange Web Service (EWS).
This file contains 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); |