5

I am building electron/angular app and I would like to open new mail window in system configured mail client.

with pre-filled fields like:

  • recipients
  • topic
  • message
  • attachment

(similar to 'send to -> email recipient' from windows context menu)

And it's need to work on Windows/Linux/Mac.

My first guess was 'mailto:', but it is not supporting attachments due to security reasons

I rather want to avoid sending email 'quietly' using nodemailer or similar

related issues:

Electron: Open default email client https://github.com/electron/electron/issues/11802

PeterJS
  • 61
  • 4
  • I have same requirement but never found a way to do this. I did learn however that the front-end javascript i.e. `mailto:` does not allow adding on the attachment or particulary the ability to access local file for instance opening a template on file. Everyone talks about doing this via a node server but I never found a code example that worked. – Andrew Allen Jul 25 '19 at 07:20
  • After some consideration, I believe it may be possible to pull this off in at least one of the three platforms. But to have one solution that works cross-platform, I don't think that's possible. But good luck! – CoryCoolguy Jul 29 '19 at 19:28
  • Windows is my main platform, and there is nothing wrong with switch casing several different solution between platforms – PeterJS Jul 30 '19 at 14:19
  • I have the same requirement but not able to sort out this. – Ravindra Vairagi Jul 31 '19 at 11:35
  • For windows, I'd recommend looking into MAPI ( https://stackoverflow.com/questions/4508/mapi-and-managed-code-experiences ). Not sure how to easily utilize these functions from Node, though. – CoryCoolguy Aug 01 '19 at 15:49

0 Answers0