The user clicks the link via email, opens the email client, how to close the window / tab?

The user clicks the link in his HTML letter, then goes to a page that simply opens his email client.

 window.location.href = 'mailto:...';

I do not want this window / tab to remain open, how can I close it?

window.close() not working since it was not opened with window.open ()

Is it possible?

+3
source share
3 answers

The browser does not control the email client, period. It launches APPLICATION, not a window.

+1
source

@Diodeus: mailto: , . , , , mailto:. , Exchange/Outlook .

, mailto: /, / .

. -.

0
var new_window = window.open(mailto:foo@bar.com");
new_window.close();

What would you like.

0
source

Source: https://habr.com/ru/post/1742472/


All Articles