Aspose.Email.Examples.CSharp.Email.Exchange.AddMembersWithoutListing.Run C# (CSharp) Method

Run() public static method

public static Run ( ) : void
return void
        public static void Run()
        {
            // ExStart:AddMembersWithoutListing
            IEWSClient client = EWSClient.GetEWSClient("https://outlook.office365.com/ews/exchange.asmx", "testUser", "pwd", "domain");
            ExchangeDistributionList distributionList = new ExchangeDistributionList();
            distributionList.Id = "list's id";
            distributionList.ChangeKey = "list's change key";
            MailAddressCollection newMembers = new MailAddressCollection();
            newMembers.Add("[email protected]");
            client.AddToDistributionList(distributionList, newMembers);
            // ExEnd:AddMembersWithoutListing
        }
    }
AddMembersWithoutListing