Saving Item.MimeContent.Content to .msg file RRS feed

  • Question

  • Hello there, 


    we're using EWS to pull some emails from the server and process attachments at a Windows service.

    We have a requirement demanding full email persistence to the database.

    I was thinking about storing the "Item.MimeContent.Content" property, but i'm not sure whether it contains all the email information. If this was true, i could save the Content byte[] to a .msg file and open it with Outlook. 

    If this scenario is not plausible, could anyone point out another ?


    Thanks in advance!


    Best regards, 


    Monday, October 10, 2011 3:30 PM

All replies

  • Hi,

    you can't save the content as .msg file. The msg file is an OLE Container format. What you get via Webservices is either the mail as structured content (XML) or the whole mail as .EML file. The latter one is the native transport format for E-Mails as described in RFC 2822.

    Outlook 2010 can open .EML files, but previous versions cannot. However, the .EML format contains the whole email with its header information; so in that sense, it's complete.

    If you need .msg files, you can use Outlook Redemption (, which is a layer on top of extended MAPI (although it has Outlook in its name, it doesn't require Outlook to be present).

    Kind regards,

    If you get your question answered, please come back and mark the reply as an answer.
    If you are helped by an answer to someone else's question, please mark it as helpful.

    Monday, October 10, 2011 6:09 PM
  • Henning,


    thanks for your reply!

    I'm going to try the save to .eml approach and get back to you soon.

    Can you assure using the MimeContent.Content byte[] is enough for this procedure ?


    Thanks in advance!


    Best regards, 


    Tuesday, October 11, 2011 1:25 PM
  • Yes, it totally worked.


    Thanks a lot!

    Tuesday, October 11, 2011 2:27 PM
  • would you mind sharing your solution on how to save these items as .eml???


    Wednesday, February 8, 2012 5:01 AM