Hi,
I’m trying to create a DL inside the PST, following your sample : Working with Distribution Lists|Documentation
I created a java sample that creates a pst with DL inside it, but the DL can’t be opened in outlook, even I’m trying to open it not just preview :
String displayName1 = "Sebastian Wright";
String email1 = "SebastianWright@dayrep.com";
String displayName2 = "Wichert Kroos";
String email2 = "WichertKroos@teleworm.us";
String strEntryId1;
String strEntryId2;
PersonalStorage pst = PersonalStorage.create("/tmp/test.pst", FileFormatVersion.Unicode);
FolderInfo contactFolder = pst.createPredefinedFolder("Contacts", StandardIpmFolder.Contacts);
// Create contacts
strEntryId1 = contactFolder.addMapiMessageItem(new MapiContact(displayName1, email1));
strEntryId2 = contactFolder.addMapiMessageItem(new MapiContact(displayName2, email2));
// Create distribution list on the base of the created contacts
MapiDistributionListMember member1 = new MapiDistributionListMember(displayName1, email1);
member1.setEntryIdType(MapiDistributionListEntryIdType.Contact);
member1.setEntryId(Base64.decode(strEntryId1));
MapiDistributionListMember member2 = new MapiDistributionListMember(displayName2, email2);
member2.setEntryIdType(MapiDistributionListEntryIdType.Contact);
member2.setEntryId(Base64.decode(strEntryId2));
MapiDistributionListMemberCollection members = new MapiDistributionListMemberCollection();
members.addItem(member1);
members.addItem(member2);
MapiDistributionList distributionList = new MapiDistributionList("Contact list", members);
distributionList.setBody("Distribution List Body");
distributionList.setSubject("Sample Distribution List using Aspose.Email");
// Add distribution list to PST
contactFolder.addMapiMessageItem(distributionList);
pst.dispose();
Please advise.
Thanks.
image.png (28.2 KB)