private void buttonSelectRecipients_Click(object sender, EventArgs e)
        {
            formSelectUsers selectUsers = new formSelectUsers(true, 0);

            if (selectUsers.ShowDialog() == DialogResult.OK)
            {
                hMailServer.DistributionListRecipients recipients = representedObject.Recipients;

                List <string> listUsers = selectUsers.GetSelectedTexts();

                foreach (string address in listUsers)
                {
                    hMailServer.DistributionListRecipient recipient = recipients.Add();
                    recipient.RecipientAddress = address;
                    recipient.Save();

                    Marshal.ReleaseComObject(recipient);
                }

                Marshal.ReleaseComObject(recipients);

                ListRecipients();
            }
        }
Beispiel #2
0
        private void buttonSelect_Click(object sender, EventArgs e)
        {
            formSelectUsers selectUsers = new formSelectUsers(true, 0);

            if (selectUsers.ShowDialog() == DialogResult.OK)
            {
                hMailServer.GroupMembers members = representedObject.Members;

                List <int> listUsers = selectUsers.GetSelectedIDs();

                foreach (int userID in listUsers)
                {
                    hMailServer.GroupMember member = members.Add();
                    member.AccountID = userID;
                    member.Save();

                    Marshal.ReleaseComObject(member);
                }

                Marshal.ReleaseComObject(members);

                ListGroupMembers();
            }
        }