Example #1
0
        public static void Run()
        {
            try
            {
                // Create instance of IEWSClient class by giving credentials
                IEWSClient client = EWSClient.GetEWSClient("https://exchange.aspose.com/ews/exchange.asmx", "asposeemail.test3", "Aspose2016", "");
                string     id     = client.GetContacts(client.MailboxInfo.ContactsUri)[0].Id.EWSId;

                // ExStart:FetchContactUsingId

                Contact fetchedContact = client.GetContact(id);
                // ExEnd:FetchContactUsingId

                Console.WriteLine("Name: " + fetchedContact.DisplayName);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }