Sangamesh Hs
Sangamesh Hs

Reputation: 1447

Screenshot and outlook email attachment - Javascript implementation

I would like to implement a button that takes screenshot of a graph on the UI and attach that screenshot to an outlook email. With this the user is able to send that attachment to other users instantly.

This have to be done on single button click.

Any ideas would be highly appreciated.

Upvotes: 0

Views: 1089

Answers (2)

Eugene Astafiev
Eugene Astafiev

Reputation: 49395

As a workaround you may consider taking a screenshot and then uploading it to your web server for further processing and sending emails. Also you can develop a plugin for browsers where you can do whatever you need. However, the end users must install it to be able to do whatever you need.

Upvotes: 0

Patrick Hofman
Patrick Hofman

Reputation: 156978

The best you have in classic javascript is the mailto protocol. Unfortunately (in this case), it doesn't support HTML bodies or multipart content. That means javascript itself won't help.

There are just a few options left:

  • If it is a company specific system, you could integrate with EWS to create a new email with attachment
  • Ask the user to download and attach the file
  • (Don't EVER do this, it is the worst idea EVER) Use ActiveX and Outlook Automation objects to create an email and add the attachment. This will only work on IE, and most companies will block this since it uses ActiveX. (As they should!)

Upvotes: 1

Related Questions