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

Free Support Forum - aspose.com

Saving MAPIMessage to MSG not working

Using your sample code (shown below) the resulting MSG files are not readable by outlook. I am using Version 2010 of outlook and latest version of Aspose.EMail. I have tried this on both PST and OST files as the source and neither are working.


private static void ExtractMsgFiles(FolderInfo folderInfo, PersonalStorage pst)

{

// display the folder name

Console.WriteLine(“Folder: " + folderInfo.DisplayName);

Console.WriteLine(”==================================");

// loop through all the messages in this folder

MessageInfoCollection messageInfoCollection = folderInfo.GetContents();

foreach (MessageInfo messageInfo in messageInfoCollection)

{

Console.WriteLine(“Saving message {0} …”, messageInfo.Subject);

// get the message in MapiMessage instance

MapiMessage message = pst.GetMessage(messageInfo);

// save this message to disk in msg format

message.Save(message.Subject.Replace(":", " ") + “.msg”);

// save this message to stream in msg format

MemoryStream messageStream = new MemoryStream();

message.Save(messageStream);

}

// call this method recursively for each subfolder

if (folderInfo.HasSubFolders == true)

{

foreach (FolderInfo subfolderInfo in folderInfo.GetSubFolders())

{

ExtractMsgFiles(subfolderInfo, pst);

}

}

}

Hi,

Thank you for using Aspose products and welcome to Aspose.Email forum.

I have tested your requirement with sample PST file and I found no problems in either extracting the messages or opening them in Outlook 2010. I have [attached ](https://apps.banckle.com/file/g/?v=q7JXwYA2zE0&f=ConsoleEmailCS.zip) my sample application in a zip archive. The bin folder contains the PST as well as extracted messages. Please try to open any email message in your Outlook. If you find any problem, please capture it in a snapshot and attach it here.

Also, send us the version of Outlook as shown in attached image [Outlook Version.png]

Thank you for the samples, They are all working but it does not work on my pst file which i have archived and attached to this message. None of the msg files can be opened. The pst file can be opened with outlook and there are no messages when doing so. My version of Outlook is the same as yours except it is the 32 bit Version and not the 64 bit.



Hi,


Thank you for your sample PST.

I am able to reproduce your said issue with your provided PST file. My sample program can extract email messages from the folder “germany-c” but I am unable to open the extracted MSG files in Outlook 2010 or MS Office Outlook 2003. I am getting the error message “Cannot start Microsoft Outlook. Cannot read the item” if Outlook program is not running. If Outlook is running then I get the message “Cannot read the item”.

Before I log this issue to our bug tracking system. Can you please tell us how this PST file was created. If produced through Outlook then please share it’s version.

Waiting for your response.

This pst file is a public domain file from the Enron litigation. I believe that it was created by converting a lotus notes database to pst. Alot of files that we see are created this way or by other conversion type tools. We are a litigation support company and that is how people exchange information with each other.

Hi,


Thank you for further information.

I have logged a ticket for this issue in our bug tracking system under ID 31517. As soon as we receive any updates from development team, we will let you know here.

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


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