예제 #1
0
        public virtual void UpdateList(MailList list)
        {
            try
            {
                WebsitePanelMailListAdmin svcLists = new WebsitePanelMailListAdmin();
                PrepareProxy(svcLists);

                MailListPostOptions postMode = MailListPostOptions.Anyone;
                if (list.PostingMode == PostingMode.MembersCanPost)
                    postMode = MailListPostOptions.SubscribersOnly;
                if (list.PostingMode == PostingMode.ModeratorCanPost)
                    postMode = MailListPostOptions.ModeratorOnly;

                GenericResult result = svcLists.UpdateMailingList(AdminUsername, AdminPassword,
                    list.Name,
                    list.ModeratorAddress,
                    list.Description,
                    list.MaxMessageSize,
                    list.MaxRecipientsPerMessage,
                    list.EnableSubjectPrefix,
                    list.SubjectPrefix,
                    list.Members,
                    postMode,
                    (list.ReplyToMode == ReplyTo.RepliesToList),
                    list.Password,
                    list.RequirePassword);

                if (!result.Result)
                    throw new Exception(result.Message);
            }
            catch (Exception ex)
            {
                throw new Exception("Could not update mail list", ex);
            }
        }