locked
.msg attachement not auto opening

    Question

  • Hi,

    When i open a .msg attachement it doesn't auto open in outlook. The download file prompt shows the extension as .asp. If I save the file, change the extension and open, it works. How ever this is working fine for other mime types(doc, xls, pdf etc).

    I am setting the content type in DB before I load data

    if instr(fileName, ".xls") > 0 then
    contentType = "application/vnd.ms-excel"
    elseif instr(fileName, ".doc") > 0 then
    contentType = "application/msword"
    elseif instr(fileName, ".ppt") > 0 then
    contentType = "application/ms-powerpoint"
    elseif instr(fileName, ".msg") > 0 Then
    contentType = "application/vnd.ms-outlook"
    end If

    for file data load in DB i use

    rs("FileData").AppendChunk fileData


    And while downloading the file

    rs.Open "select FileData,ContentType from IPC_Files where ID = " & ID, oConn.strng, 2, 4

    If Not rs.EOF Then
    Response.ContentType = rs("ContentType")
    Response.BinaryWrite rs("FileData")
    rs.Close
    Response.End
    End If
     
    i did test on both IE 6 and firefox 2.

    I also tried giving these contentTypes

    contentType = "application/outlook"
    contentType = "application/ms-outlook"
    contentType = "application/x-msg"
    contentType = "zz-application/zz-winassoc-MSG"
    contentType = "text/html"
    contentType = "text/plain"
    contentType = message/rfc822
    contentType = "message/rfc2822"
    contentType = "application/rfc2822"
    contentType = "multipart/mixed"
    contentType = "application/vnd.ms-office"
    contentType = "application/vnd.ms-Mail"
    contentType = "text/richtext"
    contentType = "application/activemessage"
    contentType = "multipart/alternative"
    contentType = "multipart/related"
    contentType = "message/outlook"
    contentType = "application/ms-tnef"
    contentType = "application/x-msoutlook"
    contentType = "outlook"
    Still no luck
     
    I tried with other intranet/internet applications which has an attachement option and found that if i attach a .msg file and later dowload it, it opens in outlook. So i doubt of any office security restrictions.

    Any help will be much appreciated.

    Thanks,
    Sajeeth
    Tuesday, February 27, 2007 10:32 PM

All replies

  • Sajeeth - Not sure if you found an answer to this issue yet, but I'm having the exact same one. If you found the answer will you please post it?

    Thursday, September 20, 2007 6:31 PM
  • Same issue, exactly. If I find an answer I'll post it.

    Monday, December 03, 2007 3:53 PM
  • You could try

    application/vnd.ms-outlook
    application/octet-stream

    Hope it help. :)
    Streit Huang
    • Proposed as answer by Streit Huang Saturday, December 05, 2009 7:53 PM
    Wednesday, June 04, 2008 8:47 AM
  • I had issues too. I got it working by setting.

     Response.ContentType = "application/vnd.ms-outlook";

    and don't forget:

    Response.AddHeader("Content-Disposition","inline;filename=urfile.msg");

    • Proposed as answer by Rory_Haynie Thursday, August 02, 2012 9:39 PM
    Thursday, July 07, 2011 5:44 PM