Пример #1
0
    public static void AddUser(string domain, string login, string password, bool MailingList, double MaxMailboxSize, bool StoreMailLocaly)
    {
        try
        {
            List <string> varNames  = new List <string>();
            List <string> varValues = new List <string>();

            varNames.Add("MaxMBSize");
            varValues.Add(MaxMailboxSize.ToString().Trim());

            varNames.Add("StoreMailLocaly");
            if (StoreMailLocaly)
            {
                varValues.Add("1");
            }
            else
            {
                varValues.Add("0");
            }

            XMLayer xm = new XMLayer();
            xm = XMServer.CreateXMLayer();
            xm.Login();
            xm.AddUser(domain, login, password, (MailingList == true) ? "M" : "U");
            xm.SetUserVariable(domain, login, varNames.ToArray(), varValues.ToArray());
            xm.Logout();
        }
        catch (Exception error)
        {
            Log.WriteException(error);
            throw;
        }
    }