How to fix an issue where Mail Activities is returning 0 attachments when there are multiple in the e-mails.
Issue Description
Get Outlook Mail Messages reads attachments through Outlook's Secure Temp Folder, a hidden staging directory Outlook uses before handing attachment data to another application. Outlook resolves duplicate filenames in that folder by appending a numeric suffix (invoice(1).pdf, invoice(2).pdf, and so on). Once it hits its limit for a given base filename, it can no longer stage a new copy. On Mail Activities versions before 2.11.x, hitting that limit does not raise an error: the activity just returns zero attachments.
Only affects emails whose attachments reuse a filename already staged many times on that machine (recurring reports, invoices, or exports with a fixed name). The same email can succeed on one machine and fail on another, depending on how full that machine's Secure Temp Folder already is.
Fixed in Mail Activities 2.11.x, generally available 2026-08-18.
Symptoms
- Get Outlook Mail Messages returns
Attachments.Count = 0for an email that has attachments. - The attachments are visible in Outlook, and reading the same email through Outlook's COM API directly returns them correctly.
- No exception or error is logged. The workflow completes normally with an empty Attachments collection.
- The same automation works on some machines and fails on others for the identical email.
Resolution
Solution 1 - Upgrade to Mail Activities 2.11.x or later (recommended)
Upgrade the project's Mail Activities package dependency to 2.11.x or later. This removes the dependency on the Secure Temp Folder for attachment reading entirely, so the issue does not recur regardless of how many duplicate-named attachments the machine has already processed. No manual cleanup needed after upgrading.
Solution 2 - Clear the Outlook Secure Temp Folder (workaround for versions before 2.11.x)
- Locate the Secure Temp Folder path via the registry key
HKCU\Software\Microsoft\Office\<version>\Outlook\Security\OutlookSecureTempFolder. - Open that folder and delete its contents. Do not delete the folder itself.
- Restart Outlook so it re-initializes the temp folder.
- Re-run the automation and confirm the affected email now returns its attachments.
This folder fills up gradually, so the workaround may need to be repeated on machines that process high volumes of same-named attachments. Solution 1 removes that maintenance entirely.
Additional Information
Classic Outlook Desktop activities depend on the local Outlook client and its Secure Temp Folder behavior, and are not compatible with the new Outlook for Windows client. If this pattern recurs and upgrading is not immediately possible, consider moving to Microsoft 365 activities, which read attachments through Microsoft Graph and are not subject to this limitation.
Reference: New Outlook impact on UiPath Outlook Desktop activities