Skip to content

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

@VikramMaiya

Description

@VikramMaiya

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions