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.
- Download the mpack utility for Windows.
- Unpack the archive and copy the file
munpack.exeto your working directory (e.g.
- Open the command promt (press
enter) and navigate to the working directory - in our case
- Run the command
for /r %i in (messages\*) do munpack.exe %i >> log.txtto unpack all mesages to the working directory and log the output to the file
That's it: now all attachments should be visible in the working dir (
C:\attachment-export). For details and possible error messages, look into