1

I would like to create a web app where you can drag and drop emails from Apple Mail (on macOS).

When I drag emails to the desktop an .eml file is created, but when I drag emails to the browser no file is being transferred, I can only get the mail’s subject like this: event.dataTransfer.getData("text"); So is it possible to drag and drop emails from Apple Mail to browsers? And if yes, then how? So far I've tried chrome and safari, but neither got any files with the dragged element. On windows with outlook or thunderbird this wasn’t an issue, so I hope it can be done with apple mail as well. Thanks in advance

Gergő S
  • 67
  • 4
  • 1
    Please visit the [help], take the [tour] to see what and [ask]. Do some research - [search SO for answers](https://www.google.com/search?q=javascript+drag+apple+mail+site%3Astackoverflow.com). If you get stuck, post a [mcve] of your attempt, noting input and expected output using the [\[<>\]](https://meta.stackoverflow.com/questions/358992/ive-been-told-to-create-a-runnable-example-with-stack-snippets-how-do-i-do) snippet editor. – mplungjan Mar 22 '22 at 10:20
  • https://jsbin.com/vuviwayeha/1/edit?js,console,output Here is a small part of my code, expected output is a file with .eml extension, if you try this with Outlook for example, you will get a .msg file, which is fine. – Gergő S Mar 22 '22 at 11:19
  • So to be more specific, i want to drag an email from apple mail to the box (which is div with id=div1) and upon dropping, i want to get the file that is being transferred with the dragged element (which is an email) as i've said, if i drag an email to the desktop then an .eml file is being created on the desktop, i want that same file in the browser. – Gergő S Mar 22 '22 at 11:26

0 Answers0