2

Although I've found a lot of information on this already from Stack, specifically here, I just want to be absolutely sure that there's no way to do this in Chrome and it can only be done in Internet Explorer.

From Stack answers and my own testing I know there is no hope of using mailto with HTML in the body, so I'm attempting to use JavaScript so that upon the user performing some action, Outlook (or whatever their default email client is) will open with the body already populated with HTML. The catch is that our users use Chrome, not IE. I tested this code in IE and it actually worked, but unsurprisingly does not work in any other browser because the ActiveXObject is not supported.

I think I already know the answer is a flat-out no, but it surprises me that there is no equivalent JavaScript for this in Chrome or other browsers.

Community
  • 1
  • 1
ncksllvn
  • 5,699
  • 2
  • 21
  • 28
  • possible duplicate of [MailTo with HTML body](http://stackoverflow.com/questions/5620324/mailto-with-html-body) – Matt S Aug 14 '14 at 20:22
  • The link you point to has a reference to the specifications where it states it's not possible, intentionally. – Matt S Aug 14 '14 at 20:23
  • 1
    I realize mailto doesn't work - that's why I asked this question. Why would I reference a question if mine is exactly the same? I'm seeking a Chrome-alternative for the JavaScript that works in IE. – ncksllvn Aug 14 '14 at 20:26

2 Answers2

2

Assuming outlook is installed, perhaps the better way is to serve a .msg file as a 'template' on the server. Upon clicking the link, the users native system SHOULD, if outlook is the default mail client, open it as a new message. I guess that depends on how dynamic the email actually needs to be though.

Otherwise, yes, activeX is a MS construct only. It's basically the reason why ie is so insecure, because you can do things like this.

There is a plugin available, but that might be a bit much to ask your users to install something to send an email https://chrome.google.com/webstore/detail/activex-for-chrome/lgllffgicojgllpmdbemgglaponefajn

BReal14
  • 1,603
  • 1
  • 12
  • 35
-3

Use the below code on your onclick function to open Outlook in Chrome/IE/FireFox

window.location.href = "mailto:?";
Gergo Erdosi
  • 40,904
  • 21
  • 118
  • 94
N. Pradeep
  • 193
  • 2
  • 7