OfficeDev / office-js

A repo and NPM package for Office.js, corresponding to a copy of what gets published to the official "evergreen" Office.js CDN, at https://appsforoffice.microsoft.com/lib/1/hosted/office.js.
https://learn.microsoft.com/javascript/api/overview
Other
675 stars 95 forks source link

Outlook Online: addFileAttachmentAsync does not work for encrypted and signed emails #3363

Open DmitryKostochko opened 1 year ago

DmitryKostochko commented 1 year ago

Provide required information needed to triage your issue

We are developing an Outlook add-in for compose mode. The addFileAttachmentAsync method does not work when an email is encrypted and signed.

Your Environment

Expected behavior

The addFileAttachmentAsync method should work as it does in Outlook Desktop. Or the method should return an error.

Current behavior

The addFileAttachmentAsync method does nothing, its callback function is never executing.

Steps to reproduce

  1. Sign in to Outlook Online using Edge or Chrome.
  2. Create a new email message.
  3. Go to … -> More options and check the “Encrypt this message (S/MIME)” and “Digitally sign this message (S/MIME)” options.
  4. Open the add-in’s pane and execute the following code:
      Office.context.mailbox.item.addFileAttachmentAsync(
        "http://i.imgur.com/WJXklif.png",
        "cute_bird.png",
        { isInline: false },
        function (asyncResult) { console.log(asyncResult); }
      );

As you can see, attachment is not added. Also, pay attention to the Console tab of Developer Tools – there is no console.log(asyncResult); there.

Link to live example(s)

Provide additional details

The addFileAttachmentAsync method works fine in Outlook Desktop. If you need any additional information, please let me know.

barclayadam commented 1 year ago

To add to this we are seeing this too with our add-in, although we are using the addFileAttachmentFromBase64Async API to add an inline image attachment (isInline equals true).

exextoc commented 1 year ago

Hey @DmitryKostochko

Thank you for reporting this issue. It has been put on our backlog. We unfortunately have no timelines to share at this point Internal tracking id: Office: [218884]

gapat-gh-msft commented 4 weeks ago

With the aforementioned procedure, I am unable to repro the issue. Could you pl verify if you still face the issue?

DmitryKostochko commented 4 weeks ago

@gapat-gh-msft, I have just tested the issue in Outlook Online with my code and cannot reproduce it, it looks like the addFileAttachmentAsync method works now.

@barclayadam, Could you please test your own code and let us know?