How to Save Outlook Emails to Your Computer
On this page
Download one Outlook email as an EML or MSG file, which stores the message in an email file, or print it to PDF. For folder backups in Outlook for Windows, export a PST file that can hold many messages and other Outlook items. mailmd creates a readable local archive that updates with new mail by copying messages to your computer as individual Markdown files. Markdown is a plain-text format that many editors and note apps can open.
Choose based on what you need: one message, a document to read or share, or a copy of many messages and folders. mailmd is a free, open-source command-line tool, meaning you run it by entering commands in a terminal. It is recommended for keeping a readable email archive. It connects to Outlook.com and Microsoft 365 through Microsoft Graph, an API that lets software access Microsoft services with your permission.
Save one email as a file #
In new Outlook for Windows, select the message and choose More actions > Save as. In classic Outlook for Windows, open the message, then choose File > Save As. In Outlook.com or Outlook on the web, open the message and choose More actions > Download. Outlook downloads the message as an EML or MSG file, depending on the version. Microsoft lists the version-specific steps in its instructions for saving an Outlook message.
To create a PDF on Windows, choose Print from the message’s menu, select Microsoft Print to PDF, then choose a folder and filename. On a Mac, use File > Print > PDF > Save as PDF in the print window. A PDF is convenient to read, but it does not automatically include the message’s attachments. Save attachments separately when you need them.
Export Outlook folders as a PST #
A PST file is an Outlook data file that can contain messages and other Outlook items. In classic Outlook for Windows, go to File > Open & Export > Import/Export, choose Export to a file, then select Outlook Data File (.pst). Choose a folder, set a destination and filename, and select Finish. To include folders inside other folders, select the account name and turn on Include subfolders. Microsoft provides separate PST export instructions for new Outlook.
In new Outlook for Windows, go to Settings > Files > Export, select Get started, and follow the export wizard. To reopen a PST in Outlook, follow Microsoft’s instructions for opening a PST file. New Outlook has specific installation and licensing requirements for opening PST files, so check those before relying on the export as your only copy.
Microsoft’s instructions for legacy Outlook for Mac cover exporting an archive as an OLM file through Tools > Export. Check your Outlook version before following the Mac export steps.
Save a readable archive with mailmd #
mailmd saves each message as a Markdown file, with attachments beside it. It organizes folders and years into directories. The --keep-raw option can preserve the original email file. mailmd does not create a PST or PDF, and it does not delete messages from Outlook.
To connect Outlook.com or Microsoft 365, create your own OAuth app in Microsoft Entra. An OAuth app lets mailmd request access through Microsoft’s sign-in service; mailmd’s Outlook connection uses read access. Then install and sync from a terminal:
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. mailmd saves the archive under ~/mail/<account>. Its folders open read-only. It does not mark messages as read. It also does not move or delete mail or send messages. A later mailmd sync adds new mail and updates read and starred marks. See the mailmd project for setup details.
mailmd does not include its own search engine. Search the files with an editor or a command such as rg, and keep a separate backup of the archive. Saving a copy to your computer alone does not protect it if that computer is lost or damaged.
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.