public void TestRenameDomainWithList() { hMailServer.DistributionList oList = _domain.DistributionLists.Add(); oList.Address = "*****@*****.**"; oList.Active = true; oList.Save(); hMailServer.DistributionListRecipient oRecipient = oList.Recipients.Add(); oRecipient.RecipientAddress = "*****@*****.**"; oRecipient.Save(); oRecipient = oList.Recipients.Add(); oRecipient.RecipientAddress = "*****@*****.**"; oRecipient.Save(); oRecipient = oList.Recipients.Add(); oRecipient.RecipientAddress = "*****@*****.**"; oRecipient.Save(); _domain.Name = "example.com"; _domain.Save(); var list = _domain.DistributionLists[0]; Assert.AreEqual("*****@*****.**", list.Address); Assert.AreEqual("*****@*****.**", list.Recipients[0].RecipientAddress); Assert.AreEqual("*****@*****.**", list.Recipients[1].RecipientAddress); Assert.AreEqual("*****@*****.**", list.Recipients[2].RecipientAddress); }
public bool SaveData() { bool newObject = false; if (representedObject == null) { hMailServer.Domain domain = APICreator.GetDomain(_domainID); hMailServer.DistributionLists lists = domain.DistributionLists; representedObject = lists.Add(); newObject = true; Marshal.ReleaseComObject(lists); Marshal.ReleaseComObject(domain); } representedObject.Address = textAddress.Text; representedObject.Active = checkEnabled.Checked; if (radioModePublic.Checked) { representedObject.Mode = eDistributionListMode.eLMPublic; } if (radioModeMembership.Checked) { representedObject.Mode = eDistributionListMode.eLMMembership; } if (optModeAnnouncements.Checked) { representedObject.Mode = eDistributionListMode.eLMAnnouncement; } representedObject.RequireSenderAddress = textRequireAddress.Text; representedObject.RequireSMTPAuth = checkRequireSMTPAuthentication.Checked; representedObject.Save(); // Refresh the node in the tree if the name has changed. IMainForm mainForm = Instances.MainForm; mainForm.RefreshCurrentNode(textAddress.Text); // Set the object to clean. DirtyChecker.SetClean(this); if (newObject) { SearchNodeText crit = new SearchNodeText(representedObject.Address); mainForm.SelectNode(crit); } EnableDisableTabs(); return(true); }
public void TestDistributionList() { hMailServer.DistributionList oList = _domain.DistributionLists.Add(); oList.Address = "persis'*****@*****.**"; oList.Active = true; oList.Save(); hMailServer.DistributionListRecipient oRecipient = oList.Recipients.Add(); oRecipient.RecipientAddress = "test@te'st.com"; oRecipient.Save(); oRecipient.RecipientAddress = "tes'*****@*****.**"; oRecipient.Save(); oList.Delete(); }
public hMailServer.DistributionList AddDistributionList(hMailServer.Domain oDomain, string sAddress, List <string> recipients) { hMailServer.DistributionList oList = oDomain.DistributionLists.Add(); oList.Active = true; oList.Address = sAddress; oList.Save(); // Add recipients foreach (string recipient in recipients) { hMailServer.DistributionListRecipient oRecipient = oList.Recipients.Add(); oRecipient.RecipientAddress = recipient; oRecipient.Save(); Marshal.ReleaseComObject(oRecipient); } return(oList); }
public void Save() { _object.Save(); }