Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing to fetch .msg file attachment from ews exchange server ews-javascript-api #418

Open
VikramMaiya opened this issue Dec 28, 2022 · 4 comments

Comments

@VikramMaiya
Copy link

I have been using ews-javascript-api for fetching the emails and attachments. The below code fails to fetch the .msg file attachments.

Approach 1: Works for non .msg file attachments but fails for .msg file type:
**await file.Load()**

Approach 2: Fails to fetch the .msg file type attachment (Refer below code).

     const {  PropertySet,  ItemSchema} = require('ews-javascript-api')

      const itemId = new ItemId(file.id)
      const ATTACHMENT_PROP_SET = new PropertySet([ItemSchema.MimeContent])
      const msgEmailItem = await EmailMessage.Bind(EWS, itemId, ATTACHMENT_PROP_SET)
      const base64Content = msgEmailItem.MimeContent.content
@gautamsi
Copy link
Owner

have you tried this approach with their C# counterpart? that will help resolve issue or find the proper code solution

@VikramMaiya
Copy link
Author

Hi Gautam, Thank you for the response. I have never programmed C#, I know only javascipt.

@gautamsi
Copy link
Owner

the problem you are facing is that someone has to know how this works, Microsoft has only c# examples, which mostly works without much modification and using await keywords only.

@gautamsi
Copy link
Owner

this library is only port of c# version, if this works in c# side it should work here. but if that does not work in c#, then it definitely not going to work here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants