How to Export Emails from Outlook
On this page
To export an Outlook mailbox, first choose whether you need an Outlook archive file or a readable copy of your messages on your computer. On Windows, Outlook’s built-in export creates a PST file, a file that can hold email and other Outlook items. For a local archive of email saved as individual files, mailmd is the best fit: it copies messages into Markdown files you can open and search on your computer.
The right method also depends on which Outlook you use. Classic Outlook for Windows, new Outlook for Windows, Outlook.com in a browser, and Outlook for Mac have different export options.
Export a mailbox from Outlook for Windows #
In classic Outlook for Windows, go to File → Open & Export → Import/Export. Choose Export to a file, then Outlook Data File (.pst). Select the mailbox or folder, choose where to save the file, and select Finish. For a whole account, select its top-level name and check Include subfolders. Microsoft’s export instructions cover these steps.
Before exporting, check that Outlook has downloaded the mail you need. Outlook keeps a local copy of mailbox messages on your computer, called a cache. Classic Outlook exports the messages available in that copy. For Microsoft 365 or Exchange accounts, set the synchronization range to All and let Outlook finish syncing. Then check that older messages open before starting the export. The export copies information and leaves the original mailbox intact, but it does not preserve every Outlook setting, such as rules and folder permissions.
New Outlook for Windows also has a PST export option. Open Settings → Files → Export → Get started, then follow the prompts to choose a mailbox or folders. If the export offers Copy and Move, choose Copy when you want to keep the messages in the mailbox. Microsoft’s new Outlook PST guidance describes these steps, though available options can vary.
Export from Outlook.com or a Mac #
Microsoft does not currently document a way to export an entire Outlook.com mailbox from the browser. Microsoft directs Outlook.com users to desktop Outlook to create a PST. For an individual message in Outlook.com or Outlook on the web, open its menu and choose Download to save it as an EML or MSG file. A PDF is a printout of a message. You cannot use it to restore a mailbox archive. See Microsoft’s instructions for Outlook.com mailbox export and saving individual messages.
Microsoft documents OLM archive export for legacy Outlook for Mac: choose Tools → Export, select the items, and save the archive. The steps do not apply to every current Mac version. Microsoft also says legacy Outlook for Mac stops working with Exchange Online mailboxes starting October 2026, so check its support notice before relying on that route.
Save Outlook email as Markdown with mailmd #
For a readable local archive, mailmd is a free, open-source tool you run by typing commands in a terminal. It saves each email as a Markdown file on your computer. It keeps attachments beside messages and turns HTML email into readable Markdown. It also organizes folders and years into directories. It does not create PST or PDF files, and it does not delete messages from Outlook.
In a terminal, connect mailmd to your Outlook mailbox and sync your messages. Outlook.com and Microsoft 365 use Microsoft Graph, Microsoft’s service for accessing Microsoft accounts; connecting this way requires your own OAuth app in Microsoft Entra. Most Outlook mailboxes no longer accept IMAP passwords. If your provider supports IMAP, use the IMAP command instead.
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 archive is saved under ~/mail/<account>. mailmd requests read access, does not mark messages as read, and never moves or deletes mailbox messages. Its login details are stored outside the archive, where only your computer user account can read them. See the mailmd project for setup instructions.
Check the export before relying on it #
Open the PST in Outlook or inspect the Markdown folder. Check that the expected folders appear, open an older and a recent message, and test important attachments. Keep the original mailbox until you have confirmed the copy is complete. For a PST, choose a local destination outside OneDrive while exporting; Microsoft warns that active PST files in OneDrive can cause sync delays or file-in-use errors.
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.