-
Notifications
You must be signed in to change notification settings - Fork 15.3k
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mailto: openExternal does not work on Windows. #1083
Comments
If you doesn't install any mail client on your system, this calling will return nothing, but if you install one it works correctly. in OpenExternal implementation. maybe should change the API signature, give some response to caller. |
With 0.21.2 on Win7 it opens Thundebird without problems. |
Did not mean to close this issue. So I can confirm that with the latest version I'm still having issues. I have outlook installed on my system, and mailto: links within the web browser open outlook just fine, it's only from within atom that nothing happens. I installed thunderbird, and the openExternal worked just once but has not worked again since, bizarrely. So I wouldn't say that it's just a return value issue. |
…tead of ShellExecute().
This only seems to affect one machine and I didn't see any other report, no one else is able to reproduce this too, so I'm blaming it to Windows. |
I'm having the problem exactly as described by @marksalvin on 0.36.2 on all Windows 7 machines I've tested. The machines did have a mail client (tried both Outlook and Thunderbird) installed and registered as the default for the Url:MAILTO scheme. |
Windows is to blame for this, definitely, but has anyone found a workaround? @bradstewart @markisadesignerd |
Hi guys. So originally, my workaround was to modify the openExternal function on Windows: if (url.spec().substr(0, 7) == "mailto:" ||
url.spec().substr(0, 4) == "tel:") {
// Use system() for mailto: and tel: URI schemes as ShellExecute() is not working
// as expected on Windows 7 or 8
std::string url_prefix = "START ";
std::string url_command = url_prefix + url.spec();
if ( ! system(url_command.c_str())) {
// System call fails. We could display a message to the user as with ShellExecute()
return false;
}
} else {
// For other URI schemes revert to ShellExecute()
if (reinterpret_cast<ULONG_PTR>(ShellExecuteA(NULL, "open",
escaped_url.c_str(), NULL, NULL,
SW_SHOWNORMAL)) <= 32) {
// We fail to execute the call. We could display a message to the user.
// TODO(nsylvain): we should also add a dialog to warn on errors. See
// bug 1136923.
return false;
} More recently I have also been experimenting within JavaScript with: window.open('mailto:<email>','_blank ') storing a reference to that window, then programmatically closing it once opened (as it seems to leave behind a redundant intermediary window in the process of opening the mail client). Hope this helps! |
Any updates on this issue? Still occurring on Windows 7 for me. |
I am also having this issue on Windows 10 (email program doesn't open when clicking a button in an Electron app). Here is the code that I used: const {ipcRenderer, shell} = require('electron');
// ... some more code
$(document).on('click', '#sendmail', event => {
event.preventDefault();
shell.openExternal('mailto:test@something.com?subject=Test');
}); |
Is there any update on this issue. I am having the same problem. |
I am weighing electron as an option for a desktop application (win7+) that requires an email to be created from within the app and this is a crucial feature. Any update on this issue or any proven work-around? |
I use it under MAC. When I click on the link, it will open the browser directly and jump to my Gmail... However, my mail client is installed by default on my computer, I want to open it via email client. How do I need to do this?
|
I've been trying to use openExternal to open the mail application from within my atom-shell app (with an email passed in), however it's not working on Windows (it's working fine on Mac). Using latest release (v0.21.0, non-symbols version).
Using:
require("shell").openExternal("http://www.google.com")
- works.require("shell").openExternal("mailto:test@test.com")
- DOESN'T work. Nothing happens. No error is thrown either in WebInspector console.The text was updated successfully, but these errors were encountered: