Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Electron: Open default email client

I am using election framework to built .exe and .dmg files. In the app I have a button, clicking on which it must open default email application installed on the system to send an email. Following is the code to open email client

shell.openExternal("mailto:[email protected]?subject=MySubject&body=");

But, it only works on few systems.

Note: It is already checked that other systems also have default email client. Is there any better way to do it. So, it will work on all system? Thanks in advance for providing help and your precious time !

like image 502
Anand Vaidya Avatar asked Dec 06 '25 16:12

Anand Vaidya


1 Answers

Unfortunately, the code shell.openExternal("mailto:[email protected]?subject=MySubject&body="); only launches the MUA which is configured as the default in the system settings. Oftentimes in older version of windows there is no default mail client set and so it won’t work regardless.

like image 192
Anand Vaidya Avatar answered Dec 08 '25 07:12

Anand Vaidya



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!