ews-js-api-browser | Exchange Web Service in JavaScript/TypeScript
kandi X-RAY | ews-js-api-browser Summary
kandi X-RAY | ews-js-api-browser Summary
Exchange Web Service in JavaScript/TypeScript. For ionic/electron and other browser process.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of ews-js-api-browser
ews-js-api-browser Key Features
ews-js-api-browser Examples and Code Snippets
Community Discussions
Trending Discussions on ews-js-api-browser
QUESTION
First of all, being a student, I lack some experience to understand everything about what I tried and what I try. But still, I feel like I've tried pretty much every solution available on the net.
I'm developing a Yeoman based Outlook add-in (full javascript with Node.js) for my company, and I came to the point where I need to get the attachments from a mail, not just the informations like size, file type or name of the attachments, I need the full content, in base64 if possible (in order to produce a .eml file containing the mail body and attached files).
I've found multiple ways to do so, problem is none of them work :
- first I tried with the messy microsoft documentation, and the first solution that I found is this one : https://docs.microsoft.com/en-us/office/dev/add-ins/outlook/get-attachments-of-an-outlook-item, problem is that with this solution I need to make use of c#, but my add-in is full js, and I need to find a solution that works with JS and Node.js
- then I looked for a solution that allows me to communicate a way or another with the Exchange Server to get the attachments content, and I found this : https://github.com/gautamsi/ews-javascript-api, but this was not working with browser oriented add-in (and I need my add-in to work on both client and browsers), so I made use of this : https://github.com/gautamsi/ews-js-api-browser. I found some code samples in the first link and here : Save outlook Email attachment using ews-javascript-api npm in node JS that helped me build something (using the second link's example's syntax on the third link's sample code) that was supposed to work, but coming to the point where I'm trying to get the attachments from the mail, I get a lot of informations from the attachment, but anything related to it's content is null, and the next step where I "Load" the file returns an error 500 from the "service" with "the document is empty", and I still don't know why yet.
- finally, I tried to take a step back, looking on google for office api and how to get attachment content, and I've found this link : https://blog.mastykarz.nl/office-365-unified-api-mail/ that almost looked to good to be true, and I was right : according to microsoft doc, I need a token in order to make work the office 365 api url, token given by Azure AD when an administrator authorizes you to obtain it (or so do I think, this is the part where the microsoft doc is the messier). Problem is, while connecting on Azure AD, I get an error displaying on the screen from the website (absolutely no details about the error), and some places that I need to access in order to get my token just wont work, displaying another error message without any details or just never loading.
I've reduced as much as possible the size of my question, not wanting to drown you under informations, sample codes, links and pics so, sorry if it may look both too long and too poor in details.
Thank you for your time, feel free to give any solution, suggestion or advice that come to your mind !
...ANSWER
Answered 2020-Mar-12 at 08:08doing the same thing, solution I found:
- Get exchangeToken in client (
Office.context.mailbox.getCallbackTokenAsync()
) - Send token, attachmentsIds, emailID to server (C# in my case, nodejs in your case)
- Use EWS Managed API 2.0 or in your case ews-javascript-api to handle loading email mimecontent (contains email + attachments) or attachment mimecontent.
- Upload file to another service or do whatever you want with it.
Before I switched to C# for serverside I was using a nodejs one for testing, so if you have questions feel free to ask.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ews-js-api-browser
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page