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

Free Support Forum - aspose.com

After switching from 3.6.0 to 3.7.1- FromAddress display name is blank in PST file after adding MailMessage instances

We recently updated from Aspose Email (Java) 3.6.0 to 3.7.1. After the upgrade, the following code block no longer sets the Sender field properly in the PST file after being imported into Outlook. To be specific, this is the sender as it appears in the message list - if you click on a particular message, the sender e-mail address shows up properly. That is because Outlook checks for the display name on the Sender field, for the value to show in the message list. After the Aspose Email update, the display name of the FromAddress is blank, for the same e-mail input text stream. Did something change in the way MailMessage class loads the display name for the from address with this update? And if so, how can I properly get the display name to load now? Again, I want to emphasize that this code block worked perfectly fine in 3.6.0 (and picked up the display name of the from address as expected). Thanks for any insight.

// emlMessageInputStream is an InputStream containing the text of the e-mail

MailMessage mailMessage = MailMessage.load(emlMessageInputStream, MailMessageLoadOptions.getDefaultEml());

if (StringUtils.isNotEmpty(externalBcc)) {

mailMessage.setBcc(MailAddressCollection.toMailAddressCollection(externalBcc));

}

final MailAddress fromAddr = mailMessage.getFrom();

if (mailMessage.getSender() == null && fromAddr != null) {

// ensure that Sender is set if it’s missing because Outlook insists on it

mailMessage.setSender(fromAddr);

}

MapiMessage mapiMessage = MapiMessage.fromMailMessage(mailMessage, OutlookMessageFormat.Unicode);

// personalStorage is an instance of PersonalStorage, and we want to add the MailMessage to a folder called “Downloaded”

personalStorage.getRootFolder().getSubFolder("Downloaded").addMessage(mapiMessage);

After some further debugging, it appears that the new version is constructing the MailMessage the same way. That is, the sender address gets set properly. What happens is, in the new version, the resulting PST file, after being imported into Outlook has a blank Sender in the reading pane. Conversely, in the PST file generated by version 3.6.0 from the exact same messages, that Sender was populated and not just empty. See this question I opened on superuser.com related to the Sender field to get an idea of what I mean when I say “Sender field.”

I’ve taken over the issue from Jeff.


I wrote code to dump the mapi properties using the aspose email library.
Interestingly, 3.7.1 creates 3 properties in the MapiMessage that the 3.6.0 doesn’t.
I removed those properties and the resulting pst file displays properly in Outlook 2013.
FYI: The property keys are 235077663, 235012127 and 8192031.
The value for the first two is null. The value for the 3rd is a copy of the email.

Hi Howard,


We are sorry for a delayed response as it took us some time to investigate the issue at our end in detail.

We have investigated this issue and found the same behavior as you have shared here with us. The issue has been logged as NETWRKJAVA-33347 in our issue tracking system for further consideration and rectification by our development team and this thread has been linked with the logged ticket. Once there is an update available in this regard, we’ll write back here to share the feedback with you.

We are sorry for the inconvenience caused to you in this regard.

The issues you have found earlier (filed as NETWRKJAVA-33347) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Sorry for the delay. I finally got around to testing the 3.9.0 release.

I still see the problem. I can attach a pst file, or the source eml files.
Let me know what you would like me to provide you to reproduce the problem.

Hi Howard,


Thank you for providing the feedback.

Please provide us with the source EML files so that we can reproduce the issue at our end and assist you further in this regard.

Sorry. I tested a server which was not yet upgraded. I have just tested the correct version and can confirm that the 3.9.0 does in fact correct the problem initially reported. Thanks. Sorry again for the confusion.

Hi Howard,


Thank you for verifying at your end and providing us with the feedback. If you have any other query/inquiry related to Aspose.Email, please fee free to write to us for further assistance.