Пример #1
0
        public virtual void CreateGroup(MailGroup group)
        {
            try
            {
                svcAliasAdmin svcGroups = new svcAliasAdmin();
                PrepareProxy(svcGroups);

                GenericResult1 result = svcGroups.AddAlias(AdminUsername, AdminPassword,
                    GetDomainName(group.Name), group.Name, group.Members);

                if (!result.Result)
                    throw new Exception(result.Message);
            }
            catch (Exception ex)
            {
                throw new Exception("Could not create mail domain group", ex);
            }
        }
Пример #2
0
        public void CreateMailAlias(MailAlias mailAlias)
        {
            try
            {
                svcAliasAdmin aliases = new svcAliasAdmin();
                PrepareProxy(aliases);

                GenericResult1 result = aliases.AddAlias(AdminUsername, AdminPassword,
                                                        GetDomainName(mailAlias.Name), mailAlias.Name,
                                                        new string[] { mailAlias.ForwardTo });


                if (!result.Result)
                    throw new Exception(result.Message);
            }

            catch (Exception ex)
            {
                if (MailAliasExists(mailAlias.Name))
                {
                    DeleteMailAlias(mailAlias.Name);
                }
                Log.WriteError(ex);
                throw new Exception("Could not create mail alias", ex);

            }

        }