Delete PST Item

Thank you very much. I can’t fix the problem. I’m still getting the same error. Could it be possible that trial version is causing the problem?

Hi,


Thank you for your reply.

The trial version prohibits the extraction/deletion of more than 50 messages from a PST. The problem discussed in your previous post in not a known issue nor an evaluation limitation. Although the problem could be sample specific, so I would request you to please share your sample PST for our review. We will quickly investigate the issue on our end, and if found to be valid, we will definitely log it in our defect database for correction purposes.

Regards,

Of course.You have one example of mail with .eml as attachment in “Inbox” (“Bandeja de entrada” in spanish) folder.


Best Regards!


Hi,


Thank you for providing the sample file.

I am currently testing the v2.0.0 Beta for publishing. Upon receiving your file, I have tested it against v2.0.0 and below mentioned sample code. The latest version throws exception (NullReference) when try to access MapiAttachment.DisplayName property. The exception has been logged as NETWORKNET-33369 in our defect database. We will soon look into the problem and provide the fix at earliest.

C#


var pst = PersonalStorage.FromFile(“outlook.pst”);
var contents = pst.RootFolder.GetSubFolder(“Bandeja de entrada”).GetContents();
foreach (var messageInfo in contents)
{
var message = pst.ExtractMessage(messageInfo);
if (message.Attachments.Count > 0)
{
foreach(MapiAttachment attachment in message.Attachments)
{
Console.WriteLine(attachment.DisplayName.ToString());
Console.WriteLine(attachment.Extension);
}
}
}

Regards,

Ok, thank you very much. Another question, is it possible to set a flag in any mail for “extract” only new mails (I mean, no processed mails) from pst?


Regards!

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


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

Hi,


I am afraid there are no means available to filter the processed mails from a PST. You have to implement your own custom filtration method for your need.

Regards,

Hi,


Thanks for being patient for the resolution of your reference issue NEWORKNET-33369.

After further investigation, we found that the
DisplayName and Extension properties returning null tells about PR_DISPLAY_NAME and
PR_ATTACH_EXTENSION properties being absent in the MapiAttachment, as the values of
these properties are taken from
corresponding MAPI properties. It also refers to the rest string properties
that take their values from MAPI properties.

Thank you very much. My trial licence has been expired and I need to do more test. Could I get another 30 days licence?


Best regards!

Hi,


Thank you for using Aspose.Email.

Please contact our Sales team by posting your requirement on Aspose.Purchase forum. Our Sales team will look into it and provide further assistance.

So, how can I get this properties from a pst item that contains .eml as attachments?


Thanks!

Hi,

Aspose.Email provides a number of MapiPropertyTag to get the details about these properties. In order to get the details about these property tags, please refer to the following functions in product offline as well as online documentation.

  • MapiPropertyTag.PR_DISPLAY_NAME
  • MapiPropertyTag.
  • PR_ATTACH_EXTENSION

If the pst item contains EML as attachment to a MSG, you can load the MSG file using MailMessage and then get it in a MapiMessage object. You can then access various property tags of the attachment using the attachment object of the MapiMessage. Here is a sample code for your reference:

MailMessage msg = MailMessage.Load(“sampleMsg.msg”);
MapiMessage mapi = MapiMessage.FromMailMessage(msg);
string s = mapi.Attachments[0].GetPropertyString(MapiPropertyTag.PR_DISPLAY_NAME);
string s2 = mapi.Attachments[0].GetPropertyString(MapiPropertyTag.PR_ATTACH_EXTENSION);

Hi! How can I liberate the use of pst ? I get an error when I try to open outlook with a pst. Thanks in advance!

Hi,

Javi OD:
How can I liberate the use of pst ? I get an error when I try to open outlook with a pst.

Can you please elaborate your requirements as what you intend to do with the PST? Also, please provide more details about the error that you are getting when opening the PST with Outlook. We will analyze the information and assist you further as soon as possible.

Hi!


pst = PersonalStorage.FromFile(PstPath,false);

When I set the writable argument to false pst file is blocked (and I can’t open in outlook at the same time). Why occurs this?

Best regards!


Hi,


Thank you for the clarification.

I would like to share with you that it’s not possible to open/read a PST file at the same time when it is opened by another application. This is the default behavior of PST file and setting the flag to false doesn’t affect this behavior. The “false” flag only enables the file to be loaded in read-only mode so that no changes can be made to it.


If I use pst file in read mode, why I can't open it with Outlook at the same time? I mean, read mode shouldn't take pst file exclusively. In my app I need to extract info from pst while Outlook is open. .PST can't permit this?

Thanks!
Hi,

Following are the two methods used for opening PST.

1. public static PersonalStorage FromFile(string fileName);
2. public static PersonalStorage FromFile(string fileName,bool writable);

Here the first one supports writing to PST by default. Whereas second function gives control to user for declaring it to be writable or not. So its just a flag for deciding whether Aspose.Email will modify the PST or not.

However this flag does not effect the behavior of outlook for opening PST. Outlook does not open a PST if its already opened by any application in any mode. So its not possible to open PST in outlook while its opened by any other program.

ok, thank you very much

Hi,


You are welcome. Please feel free to contact us if you have any additional query or feel any difficulty. We will try our best to assist you further as soon as possible.