locked
what mime type can I use for .msg files?

    Question

  • There is a file attachment feature that allows users to attach .msg files, among others. I'm not able to find the right mime type to view the attached files.

    I've tried adding a .msg mime type in the IIS, adding a registry key for .msg in the HKEY_CLASSES_ROOT\MIME\Database\Content Type. But nothing seems to work.

    I've tried using the following MIME types:

    1. appliation/x-msg (I added this to the registry but it didn't work)

    2. application/outlook(I tried adding this to the IIS mime type)

    3. message/rfc822

    4.zz-application/zz-winassoc-MSG

    5. applicaiton/msoutlook

    None of these have worked. Any sugesstions? I also tried using a generic mime type like "text/HTML", but I could only see garbage. I'm saving the file in  a SQL server 2005 database as a image. This approach works with every other kind of file except a .msg file.

    Here's my code snippet:

    Response.ContentType = "application/x-msg";

    Response.BinaryWrite(imgBinaryData);

    Response.End();

    Thanks.

     

     

     

    Tuesday, February 06, 2007 6:21 PM

All replies

  • I'm this thread. moving to the networking forum.  Hopefully they can at least point you in the right direction.

    Thanks.

    Wednesday, February 07, 2007 1:42 AM
  • I'm shooting in the dark here but...

    What file format are your .msg files?

    As far as I am aware (and possibly wrong) is that Outlook message files are not RFC822 mime type compatible. They contain proprietery data as well as the RFC822 compliant mime type info. Outlook knows that and only transmits the compliant mime type info.

    The only way to be sure is hex dump a .msg file and reverse engineer it's content to find a compliant mime.

     

    Friday, February 09, 2007 1:24 AM
  • Hi,

    Me too facing the same issue as Swapna. Any luck yet?

    Thanks,

    Sajeeth

    Tuesday, February 27, 2007 10:28 PM
  • Nope. I haven't had much time to work on that. I'm almost sure I just need to try out the solutions more carefully.Let me know if you find a solution. I'll keep u posted if I'm able to solve this.
    Wednesday, February 28, 2007 1:34 AM
  • .msg file use "application/vnd.ms-outlook" for its MIME Type.

    --add--
    (Eric Tsai just told me "application/octet-stream" work and tested either.)
    It seems this one better.
    --end--

    Test fine with:
    Server : Server 2008 w/ IIS7
    Client : XP w/ IE7 , Win2000 w/ IE6SP1

    Hope it's useful for you.
    Streit Huang
    • Edited by Streit Huang Wednesday, June 04, 2008 8:57 AM add more info
    • Proposed as answer by Streit Huang Saturday, December 05, 2009 7:23 PM
    Wednesday, June 04, 2008 8:12 AM
  • its failing with ie6
    any clue?
    Vivek
    Monday, August 03, 2009 9:02 AM
  • Try below for .msg file and see if this works or not.

     

    1. Add the new key (application/vnd.msoutlook) registry (regedit) @ HKEY_CLASSES_ROOT\MIME\Database\Content Type

    2. Add a new value to the key created in step 1.  String value = Extension and Value Data = .msg

    3. Save and close the Registry.

    • Proposed as answer by jim_it1 Wednesday, March 02, 2011 10:33 AM
    Wednesday, March 02, 2011 10:33 AM
  • Thanks for the help.  Also -- I created the following mimetype in IIS 7 for my intranet application using .msg and application/vnd.ms-outlook

    This worked 100% for me.  I noticed jim_it1 doesn't use a - in his vnd.msoutlook .  So if that did not work -- try : application/vnd.ms-outlook


    Wednesday, July 18, 2012 5:51 PM