public void CreateGroup(MailGroup group) { try { svcAliasAdmin svcGroups = new svcAliasAdmin(); PrepareProxy(svcGroups); GenericResult 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); } }
public void CreateMailAlias(MailAlias mailAlias) { try { svcAliasAdmin aliases = new svcAliasAdmin(); PrepareProxy(aliases); GenericResult 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); } }