0
outlookClient.me.folders.getFolder('Inbox').messages.getMessages().filter('IsRead eq false and HasAttachments eq true').fetchAll(10).then(function (result) {
result.forEach(function (message) {
    message.attachments.getAttachments().fetchAll(100).then(function (attachmentResult) {
        console.log('Message "' + message.subject + '" contains ' + attachmentResult.length + ' attachment(s)');
        attachmentResult.forEach(function (attachment) {
          console.log('*    "' + attachment.name + '" (' + attachment.size + ' KB)');

        });
    });
});

});

in above code i am able to get all the details of attachment except ContentBytes, please suggest me how can i get the ContentBytes of an attachment.

Jason Johnston
  • 17,194
  • 2
  • 20
  • 34
rkp
  • 15
  • 6

1 Answers1

0

The contentBytes property is only available to attachments of type FileAttachment. If it's an ItemAttachment that property will be undefined. Otherwise I believe it should work as attachment.contentBytes.

Jason Johnston
  • 17,194
  • 2
  • 20
  • 34