Implementing a Drag-and-Drop function from MS Outlook into php web application RRS feed

  • Question

  • Good morning,

    We’re looking for some development guidelines/assistance with respect to implementing a Drag-and-Drop function from MS Outlook into our web application (currently in development). Our ultimate aim is for our users to be able to drag emails from their Outlook instance into our application running in their browser. As it stands we’re able to achieve this functionality with a file (for example from the user’s desktop) but not directly from Outlook.

    Our application is being developed using Visual Studio for PHP and an SQL Server 2012 backend.

    Our progress so far:

    • We have an HTML5 control on our page which receives the javascript onDrop/OnDropStart/etc events and is able to enumerate and retrieve the content therein, files or otherwise;
    • When dragging emails (or other objects such as contacts) from Outlook (tested in Outlook 2010), we’re able to enumerate plain text data but not the MIME content of the email (message or attachments)
    • We’re able to enumerate and retrieve plain text and HTML content of an email by Ctrl+A on the contents and dragging that into the HTML control.

    Where we need assistance is in understanding how to access and retrieve the full MIME content of an email from the drag/drop events the browser has access to. We’re aware of the PIO package for Visual Studio which would enable this for a local .NET application however we don’t appear to be able to use that for a web application.

    As the product is in early development phase we’re open to suggestions and directions from Microsoft as to how we might best achieve this, including if we can get this done using .NET or ASP controls for the web application.

    I look forward to your reply



    Wednesday, September 4, 2013 10:56 PM


All replies

  • A copy of my reply from

    See Upload fails when user drags and drops attachement from email client

    In theory, you can create a browser helper object (dll) for IE (it is possible to do that for other browsers, see Google Gears) that installs its own drag/drop handler on the browser window and saves the old IDropTarget object. When a message is dragged from Outlook, you will get CF_FILEDESCRIPTOR and CF_FILECONTENTS formats (which IE does not understand), create a temporary file, and pass fake CF_HDROP (which IE knows how to handle) to the old drop handler provided by the browser.

    I did this twice (FF 3.6 and IE), and it seems to work just fine.

    Also, keep in mind that Outlook does not keep in the original MIME source. When dragging, the best you can do is get the message in the MSG format, which you can then read using either Extended MAPI (C++ or Delphi) or straight COM API (MSG is an OLE store storage file).

    Dmitry Streblechenko (MVP)
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Thursday, September 5, 2013 1:00 AM
  • Is there any way to access/replace IDropSourse on Outlook side to add CF_HDROP to IDataObject instead of registering own IDropTarget for each web browsers or other application? In this way I can create an outlook addin that will just add saving msg or attachment to a temp directory/ file and add drop file type to a data object. It seems Thunderbird works in this way when you dnd email or attachment.
    Wednesday, October 22, 2014 4:44 PM
  • No, the IDataObject is provided by Outlook. There is no way to override it. What makes you think Thunderbird does this instead of simply processing CF_FILEDESCRIPTOR and CF_FILECONTENTS formats?

    Dmitry Streblechenko (MVP)
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Wednesday, October 22, 2014 4:52 PM
  • Yes this can be done by hooking in tho the doDragDrop event. We faced the same issue and developed DragDrop for Outlook as an Outlook add-in. This way drag an drop works browser independent.
    You can download the addin from 

    Thursday, August 23, 2018 12:45 PM
  • Hi, 

         Did you find any solution? We are also facing the same issue. Browsers are unable to recognize the format of dragged object from outlook. I haven't found any potential source regarding the implementation of what Dmitry Streblechenko has suggested. Can you provide any sample example ? It would be really helpful for us. 

    Wednesday, January 9, 2019 7:11 AM