To export all attachments at once, we are going to use the free command-line tool mpack to extract attachments from .eml files. As far as I know, this is the only reliable free way to do it: all the specialized software is shareware, which means that you will need to pay to process larger numbers of messages (i.e. > 10). In a nutshell, we will need to save all required messages as .eml files in a single directory and run mpack on them.
Step 1: Save all messages as .eml files
There are probably many ways to export messages as .eml files. I used Windows Live Mail 2012, which is part of Windows Essentials and freely available. The default storage format for messages in Windows Live Mail happens to be .eml already, so all you need to do is simply connect it to your mail account via IMAP and wait until it downloads all the messages. In my case, it was Gmail and it worked like a charm. By default, the message are saved in C:\Users\[User Name]\AppData\Local\Microsoft\Windows Live Mail\
in a subdirectory named after the account.
Step 2: Batch-extract attachments from .eml files
- Copy the .eml files, you want to extract attachments from, into a subfolder in your working directory: e.g.
C:\attachment-export\messages
. - Download the mpack utility for Windows.
- Unpack the archive and copy the file
munpack.exe
to your working directory (e.g.C:\attachment-export
). - Open the command promt (press
win+r
, typecmd
and pressenter
) and navigate to the working directory - in our caseC:\attachment-export
. - Run the command
for /r %i in (messages\*) do munpack.exe %i >> log.txt
to unpack all mesages to the working directory and log the output to the filelog.txt
.
That's it: now all attachments should be visible in the working dir (C:\attachment-export
). For details and possible error messages, look into log.txt
.