Office.context.mailbox.item.saveAsync fails during OnSend function on Outlook for web/New Outlook

Victor Calarasu 15 Reputation points
2025-02-06T07:42:59.6533333+00:00

I've already asked this question but I get a 404 when trying to access it, so I'm trying to repost it.

I have an Add-in created for Outlook Web which adds headers to emails in order to send them securely. It operated both through Task Pane and on the OnSend functionality of Outlook Web.

When pressing the Outlook Send Button (OnSend function), I try to save the email as a draft in order to get the draft ID adn set some headers and then send the item using Microsoft Graph API.

When pressing the Outlook Send Button the Office.context.mailbox.item.saveAsync() function fails with :

error: OSF_DDA_Error code: 9021 message: "Connection error occurred while trying to save the item on the server." name: "SaveError"

If I save the draft manually, or it gets automatically saved by Outlook or do the same flow using the Task Pane (opening the add-in through the Apps button), it works correctly.

It is only happening on new emails.

this wasn't happening before and we didn't do any change in this part of the code. It started happening since the 31 January 2025 (I saw that there was an update of the 30th of January). could this be an issue with outlook/office-js or outlook? since this wasn't happening before this point of time and we didn't do any changes in the code?

I also raised an issue on the github page: https://github.com/OfficeDev/office-js/issues/5345

Outlook
Outlook
A family of Microsoft email and calendar products.
4,503 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
4,320 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.