2

I need to trigger a classic mailto:mail@mail.com link in a Angular 2 website, but i've found that my machine's (windows 10) "mailto" protocol is associated with "chrome" and not with "mail" app. I need to alert the user if this thing happens, but i don't know how to access to this information.

If i manually associate (within Windows Control Panel) the "mailto" protocol to Mail App, everything works fine (chrome, ie, edge, etc...).

Is there a way to do that in Javascript or Angular 2?

Richard M.
  • 41
  • 5
  • Why would you need to alert the user, when the exact thing they have _configured_ on their system happens? If you can’t deal with that the user decides which application to use to send their mails, then you have chosen the wrong tool for the job to begin with. – CBroe Aug 29 '17 at 09:24
  • 2
    Because if no Mail program is associated with a "mailto" link, the page blanks for a millisecond and nothing happens. This is not good for user experience – Richard M. Aug 29 '17 at 09:26
  • _“This is not good for user experience”_ - congratulations, you just found the most important thing about `mailto:` // What has your research turned up so far? https://stackoverflow.com/q/7214686/1427878, https://stackoverflow.com/q/836777/1427878, https://stackoverflow.com/q/2274405/1427878, https://www.uncinc.nl/articles/dealing-with-mailto-links-if-no-mail-client-is-available – CBroe Aug 29 '17 at 09:43
  • I know this is old, but just noting this anyway. Never _assume_ what the user has configured for their default mail app is wrong or otherwise doesn't make sense. For example, if it opens in Chrome, then it should open in Chrome. This is a perfectly normal use-case. Most browsers support directing `mailto:` to webmail, i.e. Mailbox.org, Gmail, Outlook, etc. If they want `mailto:` to open in VLC Media Player, then that's what should happen, extreme example, but you don't know their usage and what plugins they have installed etc. – Seth Falco Dec 14 '22 at 15:00

0 Answers0