We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Distribution List creation issues

Hi,
I’m trying to create a DL inside the PST, following your sample : https://docs.aspose.com/email/net/working-with-distribution-lists/
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)

@slavago,

We have tried this at our end with the latest version of Aspose.Email for Java API i.e. 17.9 and no such issue could be observed. The resultant PST is opened in Outlook 2016 and the Distribution list opens fine showing the comprising elements. Please try it with the latest version of the API and let us know your feedback.

Hi,
Yes, seems that upgrading to new version solved the issue.
Thanks

Is there any way that I can update distribution list in the PST ? To add additional members ?
Thanks

@slavago,

Updating distribution list in a PST is not supported at the moment. We’ll discuss this with our Product team for possible implementation or any other work around, and update you here then.

A post was split to a new topic: Distribution List in Distribution List

@slavago,

We have logged an investigation ticket under Id:EMAILNET-38848 to look into this requirement. You will be automatically notified once any update is received in this regard.

The issues you have found earlier (filed as EMAILNET-38848) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by muhammadahmad