Somebytes SoftwareSomebytes Software Development


Organize your attachments in a folder structure!

E-Mail Export mit Verzeichnisstruktur

In this tutorial you can learn how to organize your mail-attachments in a folder structure.

How to organize your attachments in a folder structure like shown above?

In this little tutorial I will show how you can tell EEAttachments to organize your attachments into a folder structure where folder-name is like C:\folder\fromaddress\file.


Organize your mail attachments into a folder structure categorized by mail address

As you see above, I start a batch file ( process.bat ), which will do the categorization by from address.

I use %from% as from address and %file% in order to touch the exported file with my batch job. Also I use the  "> C:\temp\process.log" argument to have the possibility to find errors. 

In the batch file I can now use the parameters %0 %1 %2. I use %1 as the from-address and %2 which is the file EEAttachments has saved into it's directory.

This is how the batch file looks like:

mkdir C:\temp\EEAttachments\%1
move %2 C:\temp\EEAttachments\%1\

With mkdir I create a subfolder every time a file is exported. The name of the subfolder is the from-address of the mail. I the folder is already existing, nothing is happening. At least the move line will move the exported file into the just created subfolder.