Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET Outlook Converter

 AfterLogic Forum : MailBee.NET Outlook Converter
Subject Topic: PstReader works not correct Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
bueroplan
Newbie
Newbie
Avatar

Joined: 26 November 2010
Location: Germany
Online Status: Offline
Posts: 2
Posted: 26 November 2010 at 5:18am | IP Logged Quote bueroplan

Hello Experts,

I would like to export all mails from a given PST file. For this I use the following code:


PstReader objPstReader = null;
PstFolderCollection objPstFolders = null;
MailMessage objMail = null;
string strPstName = Path.GetFileNameWithoutExtension(strPstFile).ToUpper();
string strFilename = String.Empty;
DateTime dtiReceived = DateTime.Now;
int i = 0;

objPstReader = new PstReader(strPstFile);
objPstFolders = objPstReader.GetPstRootFolders(true);

foreach (PstFolder objPstFolder in objPstFolders)
{
   foreach (PstItem objItem in objPstFolder.Items)
   {
       if ((objItem != null) && (objItem.PstType == PstItemType.Message))
       {
            objMail = ((PstMessage)objItem).GetAsMailMessage(true);
            if (objMail != null)
            {
                dtiReceived = objMail.DateReceived;   // <<--- DateTime.MinValue ist returned
                strFilename = Path.Combine(strExportDir, String.Format("{0}-{1:yyyyMMddHHmmss}{2:00000000}.EML", dtiReceived, strPstName, ++i));

                objMail.SaveMessage(strFilename);
            }
       }
   }


The export in EML-Files is actually correct, but the received-date of the e-mail is not read correctly. It is always DateTime.MinValue (01/01/01).

Can you help me?
Back to Top View bueroplan's Profile Search for other posts by bueroplan
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 26 November 2010 at 12:59pm | IP Logged Quote Alex

Use HelpDesk to submit the .PST file in question.

Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6038
Posted: 30 November 2010 at 12:52am | IP Logged Quote Igor

The file is received, developers will take a look.

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6038
Posted: 06 December 2010 at 7:31am | IP Logged Quote Igor

Try the updated version of MailBee.NET.dll and let us know if the update helps.

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
bueroplan
Newbie
Newbie
Avatar

Joined: 26 November 2010
Location: Germany
Online Status: Offline
Posts: 2
Posted: 06 December 2010 at 11:44am | IP Logged Quote bueroplan

With the new version of MailBee.NET.dll 'DateReceived' is now displayed correctly.
Thank you very much.

Unfortunately, I realized that the property 'DateSent' show also always '01.01.0001'. Can you repair this property also?

Regards,
bueroplan
Back to Top View bueroplan's Profile Search for other posts by bueroplan
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6038
Posted: 07 December 2010 at 5:19am | IP Logged Quote Igor

The thing is, regular EML message doesn't hold DateSent info, we've added it specifically for MSG-EML conversion.

You can try using the following code:

Code:
foreach (PstItem item in fItem.Items)
  {
   if (item != null && item.PstType == PstItemType.Message)
   {
    MailMessage mimeVersion = ((PstMessage)item).GetAsMailMessage();

    Console.WriteLine(mimeVersion.Header s["X-Msg-ClientSubmitTime"]);


There's no guarantee it will work as expected though. Alternately, you can try using Date property instead.

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide