none
Import into outlook RRS feed

  • Question

  • Hi,

    I am trying to import some EMails that have already been sent by Zimbra. I am using Outlook Interop and c#.

    I can recreate the EMail by using the MailItem object and I can add it to a folder but I don't see how to flag it as being sent and how to back date the send date. 

    Any help would be appreciated.

    Thanks,

    Scott 

    Tuesday, November 17, 2015 12:33 PM

Answers

  • Hello Scott,

    First of all, I'd recommend playing with any low-level property explorer such as MFCMAPI or OutlookSpy. They allow to see what properties are changed with each action in the Outlook UI and compare low-level properties. So, you may find yourself the required properties to set.

    Compose (or new) items have the PR_MESSAGE_FLAGS property (DASL name is http://schemas.microsoft.com/mapi/proptag/0x0E070003 ) set to the following value: MSGFLAG_UNSENT. Read items don't have such flags set.


    Note, you can create a post item, change its properties and then set the Message Class property to the IPM.Note back to display it in Outlook as a regular mail.
    Tuesday, November 17, 2015 12:52 PM
  • As Eugene mentioned, you can create the items as a PostItem object and then change its message class back to IPM.Note to turn it to a MailItem object later. Note that sent/unsent bit can only be changed before the item is saved for the very first time. You might also want to delete the PR_ICON_INDEX property (DASL name http://schemas.microsoft.com/mapi/proptag/0x10800003) to make sure the icon is right. What is the format of the messages that you are importing MSG files? EML? Or something else?

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Tuesday, November 17, 2015 8:01 PM

All replies

  • Hello Scott,

    First of all, I'd recommend playing with any low-level property explorer such as MFCMAPI or OutlookSpy. They allow to see what properties are changed with each action in the Outlook UI and compare low-level properties. So, you may find yourself the required properties to set.

    Compose (or new) items have the PR_MESSAGE_FLAGS property (DASL name is http://schemas.microsoft.com/mapi/proptag/0x0E070003 ) set to the following value: MSGFLAG_UNSENT. Read items don't have such flags set.


    Note, you can create a post item, change its properties and then set the Message Class property to the IPM.Note back to display it in Outlook as a regular mail.
    Tuesday, November 17, 2015 12:52 PM
  • As Eugene mentioned, you can create the items as a PostItem object and then change its message class back to IPM.Note to turn it to a MailItem object later. Note that sent/unsent bit can only be changed before the item is saved for the very first time. You might also want to delete the PR_ICON_INDEX property (DASL name http://schemas.microsoft.com/mapi/proptag/0x10800003) to make sure the icon is right. What is the format of the messages that you are importing MSG files? EML? Or something else?

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Tuesday, November 17, 2015 8:01 PM