How to Download Attachments from Multiple Outlook Emails
On this page
Outlook’s built-in Save All Attachments and Download all commands save attachments from one email at a time. They cannot export attachments from multiple selected messages at once, as Microsoft explains in its Outlook attachment instructions.
If you want a local copy of attachments from multiple Outlook messages, mailmd is a good choice when you want to archive the messages with their files. It saves each email as a Markdown file, a plain-text file that is easy to read and search, and stores the attachments beside it. mailmd works with Outlook.com and Microsoft 365 through Microsoft Graph, Microsoft’s service for accessing Microsoft 365 data.
Use mailmd to save attachments from Outlook mail #
mailmd copies messages and attachments into a local archive. It does not change or delete mail in Outlook. To connect an Outlook.com or Microsoft 365 mailbox, you need an OAuth app, which lets mailmd ask for permission to read your mail. For these Outlook services, that means creating an app in Microsoft Entra and using its client ID.
On macOS, Linux, or Windows in Git Bash, install mailmd and connect the mailbox:
curl -fsSL https://raw.githubusercontent.com/vincentsch/mailmd/main/install.sh | sh
mailmd connect outlook --client-id <id>
mailmd syncReplace <id> with the client ID from your OAuth app. The login asks for read access, and you enter your password yourself. mailmd saves the archive under ~/mail/<account>. Each email becomes a Markdown file, and its attachments are stored alongside it in the archive’s folder and year directories.
To limit what mailmd copies, use --folder to choose which folders to copy. Use --exclude to skip folders and --since to set the starting date. Check the archive before relying on it. mailmd copies mail based on the folders and date you set. It does not search for specific attachments or export attachments only from messages you select. See mailmd’s documentation and code for setup details.
For a recurring local copy, run mailmd sync again. Later runs add new mail and update whether messages are marked as read or starred. They do not remove archived files when mail is deleted from Outlook.
Find messages and understand Outlook’s built-in options #
Search helps you find messages with attachments, but it does not download attachments from multiple messages at once. In classic Outlook for Windows, search for hasattachments:yes. In new Outlook and Outlook on the web, search by sender or keyword, then use the Files filter. Microsoft describes these options in its instructions for finding messages with attachments.
For a few emails, open each message and save its attachments individually. Classic Outlook for Windows offers Save All Attachments; new Outlook and Outlook on the web offer Download all. Outlook for Mac also has a Download All command for multiple attachments in one message. These commands apply to one message at a time, as described in Microsoft’s attachment instructions for Outlook and Outlook for Mac.
Check the saved files before deleting email #
Before deleting anything from the mailbox, open several saved attachments and compare them with the messages they came from. mailmd preserves the archive if a message is later deleted from Outlook, but it does not free mailbox storage by itself. It also does not convert messages to PST or PDF or import them back into Outlook. Keep the archive in a folder covered by your normal computer backup.
Free and open source
Try mailmd
mailmd is a free command-line tool that copies your email into Markdown files on your computer, one file per message. It works with any IMAP mailbox, and with Gmail and Outlook through their own APIs.
Install
$ curl -fsSL https://raw.githubusercontent.com/vincentsch/mailmd/main/install.sh | sh
Set it up with your coding agent
Set up mailmd so you can read my email. Use https://github.com/vincentsch/mailmd: read its AGENTS.md and follow the steps. Connect my mailbox and run the first sync. Then show me where the files are.