Skip to content

getAttachmentContentAsync fails with error code 5001 when file is attached via Windows "Send to" context menu #6581

@Hfcda

Description

@Hfcda

Your Environment
Platform: PC desktop

Host: Outlook

Office version number: 2602 build 19725.20152

Operating System: Windows 11

Browser: N/A

Expected behavior
getAttachmentContentAsync should successfully retrieve attachment content (Base64) for all file types (csv, txt, pdf, jpg, etc.) when a file is attached via the Windows 11 right-click "Send to > Mail recipient" context menu.

Current behavior
getAttachmentContentAsync returns Failed with the following error for csv, txt, and pdf files:

{
"status": "failed",
"code": 5001,
"message": "An internal error has occurred."
}

jpg files are unaffected and return successfully.
Re-attaching the file manually resolves the issue.

Steps to reproduce
Right-click a file (csv, txt, or pdf) in Windows 11 Explorer

Select "Send to" > "Mail recipient"

Outlook opens a new compose window with the file already attached

Send the email

The ItemSend add-in event fires and calls getAttachmentContentAsync for the attachment

The callback receives result.status === "failed" with error code 5001

Link to live example(s)
N/A

Provide additional details
The issue is reproducible only when the attachment is added via the Windows "Send to" context menu

Manually re-attaching the same file (drag & drop or Attach File button) resolves the issue

jpg files attached via the same "Send to" method do NOT reproduce the issue

Affected file types confirmed: csv, txt, pdf

Context
This issue occurs in an ItemSend add-in that uses getAttachmentContentAsync to retrieve attachment content for processing before send. When users attach files via the Windows "Send to" shortcut (a common workflow), the add-in fails to retrieve the attachment content and blocks sending.

Useful logs
Console errors
{
"status": "failed",
"code": 5001,
"message": "An internal error has occurred."
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions