1

Possible Duplicate:
Attach File Through mailto URI

I have an HTML link like

<a href="mailto:someone@example.com?Subject=Hello">Send Mail</a>

I would like attach a file in the Mail Client when a User click the this link.

Is it possible in JavaScript or using jQuery, html5?

Community
  • 1
  • 1
GibboK
  • 71,848
  • 143
  • 435
  • 658

2 Answers2

1

No.

And of course JQuery won't help since that is also Javascript.

You really need something serverside to manage this for you.

Erwin Moller
  • 2,375
  • 14
  • 22
1

You can try MS ActiveX:

var OA = new ActiveXObject('Outlook.Application');
var OAItem = OA.CreateItem(0);

var OAItemAtms = OAItem.Attachments;
OAItemAtms.add('http://foo.com/some_image.png');

You can read more on this here - compose-and-send-e-mail-from-javascript-by-using-outlook

happyCoda
  • 418
  • 2
  • 2
  • 2
    Yep, but it's still a solution :) – happyCoda Oct 09 '12 at 12:47
  • 1
    http://en.wikipedia.org/wiki/Browser_usage and dropping. You won't target one quarter of the market with that. :-( – Erwin Moller Oct 09 '12 at 12:48
  • Well... 23.65% usage of IE. That's m.b. quite enough and @GibboK didn't say anything about certain browser he wants to use his code in:) – happyCoda Oct 09 '12 at 12:53
  • Bear in mind that [**IE no longer supports this**](https://blogs.windows.com/msedgedev/2015/05/06/a-break-from-the-past-part-2-saying-goodbye-to-activex-vbscript-attachevent/#5ftMjdBRywuiEqYe.97). ActiveX is well and truely dead – Liam Oct 28 '16 at 08:33