// Deactivate account
 private static bool AccountActivate(string userName, string password, string domainName, string accountAddress, bool active = true)
 {
     hMailServer.Application hMailApp = Authenticate(userName, password);
     hMailServer.Domain      myDomain = hMailApp.Domains.ItemByName[domainName];
     hMailServer.Account     account  = myDomain.Accounts.ItemByAddress[accountAddress];
     account.Active = active;
     account.Save();
     return(true);
 }
 // Create mailbox, Account: [email protected]
 private static bool AccountCreate(string userName, string password, string domainName, string accountAddress, string accountPassword, bool accountActive = true, int maxSize = 1000)
 {
     hMailServer.Application hMailApp = Authenticate(userName, password);
     hMailServer.Domain      myDomain = hMailApp.Domains.ItemByName[domainName];
     if (myDomain != null)
     {
         hMailServer.Account account = myDomain.Accounts.Add();
         account.Address  = accountAddress;
         account.Password = accountPassword;
         account.Active   = accountActive;
         account.MaxSize  = maxSize;
         account.Active   = true;
         account.Save();
         return(true);
     }
     else
     {
         return(false);
     }
 }