public void TestRenameDomainWithList() { DistributionList oList = _domain.DistributionLists.Add(); oList.Address = "*****@*****.**"; oList.Active = true; oList.Save(); 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(); DistributionList 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 void TestDistributionList() { DistributionList oList = _domain.DistributionLists.Add(); oList.Address = "persis'*****@*****.**"; oList.Active = true; oList.Save(); DistributionListRecipient oRecipient = oList.Recipients.Add(); oRecipient.RecipientAddress = "test@te'st.com"; oRecipient.Save(); oRecipient.RecipientAddress = "tes'*****@*****.**"; oRecipient.Save(); oList.Delete(); }
public DistributionList AddDistributionList(Domain oDomain, string sAddress, List <string> recipients) { DistributionList oList = oDomain.DistributionLists.Add(); oList.Active = true; oList.Address = sAddress; oList.Save(); // Add recipients foreach (string recipient in recipients) { DistributionListRecipient oRecipient = oList.Recipients.Add(); oRecipient.RecipientAddress = recipient; oRecipient.Save(); Marshal.ReleaseComObject(oRecipient); } return(oList); }
public DistributionList AddDistributionList(Domain domain, string sAddress, List <string> recipients) { DistributionList list = domain.DistributionLists.Add(); list.Active = true; list.Address = sAddress; list.Save(); // Add recipients foreach (string recipientAddress in recipients) { DistributionListRecipient recipient = list.Recipients.Add(); recipient.RecipientAddress = recipientAddress; recipient.Save(); Marshal.ReleaseComObject(recipient); } return(list); }