Hi Ian Hockaday,
Thank you for reaching out to Microsoft Q & A forum.
When you drag and drop an email from Outlook into a web form, it gets saved as a .msg file, which browsers can't directly read.
1.Basic JavaScript Handling You can capture the dropped file, but extracting its content isn’t possible in the browser alone:
const handleDrop = (e) => {
e.preventDefault();
const file = e.dataTransfer.files[0];
console.log("Filename:", file.name);
};
2.Backend Processing Since .msg files require special handling, you’ll need to upload the file to a backend and use a library to extract its details:
Node.js: msgreader
Python: extract-msg
3.Outlook API Integration If you want to fetch email details directly, consider:
Microsoft Graph API (For Office 365 emails)
EWS (Exchange Web Services) (For Exchange servers)
Since Microsoft.Office.Interop.Outlook only works in desktop apps, a backend-based approach is the best solution for web applications.
If you have found the answer provided to be helpful, please click on the "Accept answer/Upvote" button so that it is useful for other members in the Microsoft Q&A community.