Save all attachments
Save the attachments of every email in a folder that matches the filters, optionally marking those emails as read.
Command in the Microsoft 365 toolkit · id ooa.microsoft365/save_all_mail_attachments · 15 inputs (1 required), 2 outputs
Inputs
| Input | Type | Required | Default | What it is |
|---|---|---|---|---|
| Access token | Credential | No | Microsoft Graph access token from the vault; or leave it empty and choose a connection that signs in, which gets and renews the token. | |
| Target folder | File | Yes | Folder to save into. | |
| Name pattern | String | No | * | Only names matching this pattern, e.g. *.pdf. |
| Folder | String | No | inbox | Folder id or well-known name: inbox, archive, sentitems, deleteditems. |
| Unread only | Boolean | No | false | Only unread emails. |
| From contains | String | No | Sender contains this text; separate several with ; to match any of them. | |
| Subject contains | String | No | Subject contains this text; separate several with ; to match any of them. | |
| Read only | Boolean | No | false | Only emails already read. |
| Since | DateTime | No | Received on or after this time (UTC). | |
| Before | DateTime | No | Received before this time (UTC). | |
| Overwrite | Boolean | No | false | Replace files of the same name instead of adding a number such as (2). |
| Mark read | Boolean | No | false | Mark each matching email as read afterwards. |
| Maximum results | Number | No | 1000 | Most emails handled in one run. |
| Mailbox | String | No | me | Mailbox: me, or a user's email address (needs application permission). |
| Endpoint address | String | No | https://graph.microsoft.com/v1.0 | Graph endpoint; change only for national clouds or testing. |
Outputs
| Output | Type | What it is |
|---|---|---|
| files | List | Saved file paths. |
| email_count | Number | Number of emails that matched. |