Streamline Your Inbox: How to Merge Varying Email Attachments into a Single PDF

How many times have you had to open an email, download three different attachments—say, a Word document, an Excel sheet, and a JPEG image—and then manually convert and piece them together into a single file for a report or compliance archive?

If you deal with high volumes of correspondence, this manual process is an absolute time-sink. Fortunately, you can completely automate this workflow. Using Mail Attachment Downloader PRO Server by Gearmage, you can automatically convert emails and their multi-format attachments into one cleanly merged, single PDF file.

Here is a step-by-step guide on how to set it up, along with tips on how to filter out unwanted attachments like email signatures or logos.

Why Merge Emails and Attachments?

  • Simplified Archiving: Store the entire context of a conversation—the email body and its files—in one place.
  • Audit and Compliance: Perfect for legal, financial, or corporate environments that require unalterable records of complete email threads.
  • Easy Sharing: Send clients or stakeholders a single comprehensive document rather than an overwhelming pile of separate attachments.

Step 1: Capture the Email Body

To make sure your final PDF includes the actual text of the email as the opening pages, you need to save the email text first.

  1. Open your Mail Attachment Downloader PRO Server dashboard.
  2. Navigate to the Global filters tab to create a new filter rule (or edit an existing one).
  3. Ensure that the “Save as .eml” checkbox is checked.

Step 2: Filter Out Unwanted Attachments

Before converting files, you want to make sure you aren’t accidentally merging junk files—like social media icons from email signatures or small header logos—into your final clean PDF. You can fine-tune your rule’s filters to exclude specific files:

  • Exclude by Name or Extension: You can configure the filter to skip attachments matching specific extensions (e.g., excluding .png if you only want documents) or matching specific text. This allows you to exclude files by their full name or parts of the name (such as ignoring anything containing the word “logo” or “signature”).
  • Exclude Smaller Attachments (Size Thresholds): Embedded image content, like buttons and badges in an email footer, are usually very small. You can set a minimum file size threshold in your filters to automatically exclude smaller attachments (e.g., skipping any file under 10 KB or 15 KB). This ensures only actual, substantial document attachments make it to the final merge.

Step 3: Set Up Document Conversion for Varying Formats

Once your filters ensure only the correct attachments are being processed, you need to instruct the program to convert all these different incoming formats into PDFs.

  1. Under the Actions menu on your rule, click Add action and select Document conversion.
  2. In the list on the left, click on the Document conversion item under After saving file.
  3. Click the “Add conversion” button on the right.
  4. Select your From Type (the source format, e.g., DOCXTXTHTMLRTFXLSXJPG) and set the To Type to PDF.
  5. (Optional) If you receive multiple formats, repeat this step to add conversions for Cells (XLSX), Slides (PPTX), and Images (JPG/PNG).
  6. Crucially, check the “Delete source files after conversion” checkbox. This ensures your folder doesn’t get cluttered with the original separate files once they become PDFs.

Step 4: Combine Everything into a Single PDF

At this point, the software will have turned your email body and all your filtered attachments into individual PDF files. The final step is to bind them together.

  1. Right-click on the Document Conversion action you just configured.
  2. Select “Add Merge PDF files” from the context menu.
  3. Check the “Delete all source PDFs” checkbox (this removes the temporary, individual PDFs after they are combined).

The Result

Once this automation runs, the tool handles everything in the background. When an email hits the inbox, Mail Attachment Downloader PRO Server filters out the junk, converts the important files, and builds your document.

Your final output folder will contain a single, unified PDF file. The first few pages will display the email body text, and the subsequent pages will smoothly transition into the rendered attachments, completely clean of clutter.

Going Beyond PDF

If your workflow demands other formats, the PRO Server edition supports conversion into over 50+ formats (including multi-page TIFFs, HTML, JPEG, and more). You can even check the “Encrypt PDF” option during setup if you need to secure sensitive data with a password automatically.

Further reading

Some interesting how-to links and posts for further exploration:

Contact us

Contact us if you have any questions, suggestions about the functionality described in this article.

How to Automatically Save Outlook Attachments to a Local Network Folder

Managing a high volume of incoming invoices, purchase orders, or data reports across multiple Outlook accounts can quickly become a manual bottleneck. If your business relies on downstream automation tools—like OCR scanners, document archiving systems, or ERP software—you need a reliable way to extract those files and place them exactly where they belong.

With Mail Attachment Downloader PRO, you can completely automate the extraction of emails and attachments, routing them directly to your local network folders.

Here is a step-by-step guide on how to configure multiple email accounts, set up advanced rule filtering, and safely route your files straight to a shared local network folder.

Step 1: Connect Multiple Outlook / Email Accounts

If you are managing attachments coming into different corporate mailboxes (e.g., invoices@yourcompany.com and sales@yourcompany.com), you don’t need to configure separate processes for each.

  1. First, add your individual Outlook or IMAP accounts to the account list in the main program window.
  2. In the Account dropdown menu, select the <multiple@multiple> option.
  3. A chooser window will pop up, allowing you to check all the specific email accounts you want to actively monitor simultaneously.

Note for Server Deployments: If you are running PRO Server to handle this 24/7 in the background as a Windows Service, select <multiple@multiple> first, navigate to the Service tab, and click Install service.

Step 2: Create a Global Filter Rule

Once your accounts are linked, head to the Global Filters tab. Global Filters evaluate incoming items top-down. If an attachment matches a rule, the program executes the rule’s phases and then stops processing subsequent rules for that specific file.

  1. Click Add new filter and give it a descriptive name (e.g., Invoices - Shared Network Folder).
  2. Isolate by Account (Optional): By default, a global rule runs against all connected accounts. If you want this specific network routing to only apply to one account, click Add -> Filters -> Account, and choose the specific email address from the dropdown.
  3. Define Your Matching Criteria: You can isolate specific emails by subject line or sender. For instance, click Add -> Filters -> Email Subject. You can type search terms like Payments or Invoices.
    • Pro-tip: Using no quotes does a standard substring match. You can use logical operators with quotes to create powerful rules, such as 'Payments' OR 'Invoices'.

Step 3: Configure the Local Network Save Folder (Crucial UNC Paths)

The Save phase is where you control exactly where the attachments land. When you are directing files to a local network folder or network-attached storage (NAS), your path formatting matters immensely.

  • CRITICAL: Use UNC Paths, Not Mapped Drives. If you are using the PRO Server version running as a Windows Service, it operates in a background session that cannot see mapped network drives (like Z:\NetworkFolder). You must use the absolute UNC path format: \\ServerName\SharedFolder\SubFolder\
  • Enforce Unique Filenames: Always include the {ID} token in your Saved filename format (e.g., {FILENAME}_{ID}{EXT}). Mail Attachment Downloader uses multiple concurrent threads to download files rapidly. If two emails contain attachments with identical names (such as invoice.pdf), omitting the unique {ID} field can cause download conflicts or accidentally overwrite files.
  • Dynamic Folder Structure: You can dynamically generate folders on your network share on the fly. Inserting a backslash (\) into your filename format instructs the program to build subdirectories based on metadata. For example: \\YourNAS\CompanyFiles\{EMAIL_FROM}\{FILENAME}_{ID}{EXT} This rule will automatically organize your network share by creating a unique subfolder named after each sender’s email address.

Step 4: Include Email Bodies or Post-Processing Actions (Optional)

  • Save the Entire Email: If your downstream workflow requires the email message context alongside the attachment, check the Save as .eml box. This will archive the entire email file into the same target network folder.
  • Add Post-Download Actions: In the Actions after save section, you can add automated workflows to occur immediately after the file hits your network share. This includes converting documents (e.g., .docx to .pdf), unzipping compressed files, or calling custom in-house scripts to alert your ERP system that a new file has arrived.

Step 5: Save and Deploy

Click Save on your rule. If you are utilizing the PRO Server version to run this unattended 24/7, remember to open the Service tab, click Uninstall service, and then Install service to successfully push your updated global rules to the background system.

Your local network folders will now stay perfectly organized, updated, and fed with the right email attachments completely hands-free!

Further reading

Some interesting how-to links and posts for further exploration:

Customizing filenames or email data using fields

Mail Attachment Downloader PRO versions offers you flexible file naming and extraction capabilities. This post explores how you can use the fields helper to customize filenames and fields used within the program.

How to open the fields helper

Fields helper button next to many text fields in the Rule filter window

The little [i] button (see screenshot above) next to many text input fields offers you the capability to pop-up the fixed fields helper dialog.

Fields helper popup

Fixed fields are those that are built-in to the program (see screenshot below).

Fields helper pop-up

Customizing fields output

Most text fields are pretty straightforward and are self explanatory.

Some text fields offer you the ability to customize the output. Below you will find all such fields available in the fields helper.

  • ATTACHMENT_COUNT[‘.pdf’ OR ‘.xml’]
    You can specify the specific filename/extensions such as ‘.pdf’ OR ‘xml’ and include other extensions that you see fit. You can then use this in the rule to filter out emails that the rule applies to.
  • Dates formatting – DATE, DATE_LOCAL, DATE_UTC, PROCESSED_DATE, PROCESSED_DATE_LOCAL, PROCESSED_DATE_UTC
    Each of the date fields offers you the ability to customize the date format specified within square brackets []. Example: DATE[yyyy-MM-dd] will end up formatting the date part only excluding the hours minutes and seconds from the date. For a full reference of what you can specify within the square brackets see here.
  • EMAIL_HEADER[FROM]
    Email header field offers the ability to selectively pick out a certain email header field by specifying them inside the square bracket.

Examples of customization

Many email download actions such as the following: Save .csv metadata, Merge PDFs also support the ability to append to existing files if they exist.

Example-1: A running daily log of all attachments downloaded

So for example, if you wanted a running daily history of all files that were saved and the email metadata for those files in a csv, you can do so by clicking the Save .csv metadata action and then specifying the PROCESSED_DATE_LOCAL[yyyy-MM-dd] with the date field truncated to just the day will enable the action to append to the same file.

Example-2: Merging all PDF files and keep a running log for the day

Fields helper button next to many text fields in the Rule filter window

We hope that this post provides you an insight into more of the powerful functions enabled by the program.

Nesting email rules and actions

Latest builds of v3.2 provides new capabilities such as nesting rules or actions. Make sure you upgrade the build to the latest before you proceed to read through this blog post.

This blog post explores how you can nest rules or nest actions like a PRO.

Nesting rules

Preface – Processing emails with Global filters offers the ability to save emails or attachments into different folders based on some criteria and take actions on them.

You do not need to learn about nesting (described here) for most common cases. Nesting is only useful for advanced cases.

If you are not familiar yet with the Global filters, we have a great blog post here that should help you get started.

Proceed to read on only if you are familiar with how Global filters work.

STOP here and read through this blog post to familiarize yourself with Global filters

This post is about how nesting rules can come in handy when you want to cover some advanced scenarios. Some examples where this can be useful include:

  • When no rules match for a specific email, perform certain actions such as move emails to an error folder that you can take a look at.
  • When you may have multiple attachments in an email each of which have different possible actions.
  • When you want to share a set of actions or email filters amongst many rules so you don’t have to re-type them all over again.

The global filters tab in the PRO versions offer you the ability to define three types of rule filters: an Email Filter, a Global Rule or a Negative Rule, Shared Action. The Rule Type dropdown (shown below) enables you to select the type of the rule.

Read on to explore the different rule types below by using an example.


Tutorial with an Example….

Example: Consider an example where we want to target all emails that have the term “Invoice ID” in the Subject. We also want to move the .pdf’s in such emails to a PDF prefixed folder and .doc’s in such emails to another folder prefixed by doc. Also, if no pdf or doc’s are present, we’ll move the email to an “Issues” folder. And lastly we want to use a Shared Action to save the doc/pdf related email header data (from/to/subject etc.) to a database.


Rule types in an email rule
Different Rule Type’s in a Global filter rule

Let’s start by creating a new Email Filter.

Go to the Global filters tab and Add new, in the popup select the Rule Type as shown above and change it to Email Filter if it’s not already selected.

Email Filter: This enables you to instruct the program to filter processing to either a specific email or to target a group of emails matching the filters you specify here. This rule does not, in and of itself, enable you to save emails or attachments to folders or even define actions that you can take after saving files. Those sections will show up disabled as a result.

Read on to see how Email Filters can have Global Rules as child rules…
An Email Filter that matches emails with the Subject containing “Invoice ID”

You can then save this rule and it’ll show up in the Global filters tab as shown below.

Global filters tab showing one Email Filter

Global Rule: This type of rule enables you to specify which attachments you want to filter down to and where to save them. It also enables you to define actions that you can take after saving the file. You can define a Global Rule as a standalone rule (at the root level) or as a child of an Email Filter.

Read on to see how you can setup multiple Global Rule‘s to save files to different folders

To create a Global Rule as a child of an Email Filter, right click on the email filter and add a new Global rule as shown below.

Add a new Global Rule as a child of the Email Filter defined earlier

Let’s have this rule save the email attachments that are PDFs to a “PDF” folder. This has a filter of Attachment count greater than and a filename option of pdf.

Global Rule that saves PDFs to a prefixed folder pdf\ as highlighted

Since this is a “child rule” of the Email Filter we defined above, the Global Rule will only run for emails with a subject that contains “Invoice ID” that we defined earlier. We have also setup a Mark as read action as shown above. You can add any other action like Move email to folder to move the email to a different folder if you want.

Global filters showing Global Rule that’s a child of the Email Filter

Now, let’s define another Global Rule that saves .doc or .docx’s into a different folder. Right click again on the Email Filter in the Global filters tab and select Add new -> Global Rule. Setup the Global Rule as shown below.

Global Rule: Save docx or doc extension attachments to a doc\ prefixed folder

At this point you should see Global filters tab as shown below (Email Filter being the parent with two child Global Rules).

Negative Rule: This type of rule lets you specify “catch-all” actions when none of the Global Rules match. To do this, we will right click on the Email Filter again and select Add new -> Negative Rule. This type of rule doesn’t offer you the ability to save anything (this will show up disabled).

Read on how to setup a Negative Rule under an Email Filter as a “catch-all” rule
Adding a Negative Rule

Let’s now configure the Negative Rule to copy the email to the “Issues” mailbox folder.

If no Global Rule‘s match for this Email Filter, move email to the ‘Issues’ mailbox folder

Lastly, lets create a Shared Action. Go to the Global filters tab and right click anywhere (not on the Email Filter like we did earlier as Shared Action will show up disabled if you do that). Then select Add new -> Shared Action.

Shared Action: This type of rule has no save options enabled but will have additional filters or actions that you can define. These actions are those that you want to share amongst many Global Rules.

Read on to see how to use a Shared Action to save email data to a DB

We’ll create a new Shared Action as shown below.

A Shared Action to save email data to a database

To configure the program to save to a database, refer to this blog post. We won’t show that here.

Now let’s add this Shared Action to the Global Rules we defined earlier. Multi-select the two rules in the filter tab and then right click and select Add ‘Shared Action’ to selected option as shown below.

Add a Shared Action to selected Global Rule‘s

In the popup that follows, select the shared action we called “Save emails to a database” and click OK.

That’s it.

Summary of the final setup for the example

Now we have setup rules to process the emails with the Invoice ID in the Subject with the Email Filter. Then configured child Global Rules to save PDF and DOC attachments to different folders. We also defined a Negative Rule that moves the email to an ‘Issues’ folder when no attachment arrives. Lastly, we configured a Shared Action for the Global Rules to save the email data to a database.

Nesting rules are a great way to take advanced actions

Nesting actions

Similarly you can nest actions inside a rule as shown below after saving the attachment.

The below shows how you can unzip a file, do a document conversion and then save to a database and run a command line operation.

automate email actions: unzip_files
Nest actions inside a Global Rule or a Shared Action

For more on this, read this blog post here.

Why did my rule not download the attachment or email?

This post will go over common troubleshooting steps to help you set up the correct email rules to get the behavior you want.

First off, this post only covers the PRO versions in depth. For the free version, refer to the free download page for instructions.

The assumption for the rest of this post is that you are using the global rules tab to setup the download.

So global filters are critical for the best use of the PRO Client and PRO Server versions. If you have not already setup global filters or rules, the recommendation is to do that as soon as possible.

Here are a few blog posts to help educate yourself about the PRO product and the use of global filters:

    1. IMPORTANT (READ THIS FIRST): Setup global filters for your email attachment processing. Learn about filters, extractions, save locations and actions inside a rule.
    2. If you work with multiple email accounts, learn how to set them up using global filters — multiple email accounts setup
    3. Configure the rules to save email bodies or attachments as PDF or other formats. 
    4. Understand the intricacies of setting up rules to extract data from emails or attachments. Then use that extracted data in actions.
    5. If you work with databases, learn how to save or read data from a database and use them in your actions.
Bookmark the tips and tricks page for tips on how to use the program.

Why did my rule not work?

To answer this and/or other questions like why the rule did not download the attachment or email, enable Rule Tracing.

The best way to troubleshoot any rule is to enable this new feature we have introduced called Rule Tracing. So rule tracing helps you  trace through what happened when a connect and download was initiated.

Rule tracing walks you through how the program decided to process the emails. It helps you understand which rules matched or did not match for every email or attachment that was processed!

Latest build

Only the latest build (v 3.2.1015 or later) has this new Rule Tracing functionality. So make sure you upgrade to this latest build.

Upgrading is easy. All settings are always preserved while upgrading.

NOTE for PRO Server users:  If you are running a service, uninstall the service from the Service tab first. Not doing this may interrupt the installation of the latest build.

  • Free instructions — If you are using the free version, just go to our website to get and install the latest build.
  • PRO instructions — If you are using the PRO versions, use the SAME link that you received in your license email to install the latest build. Your settings will be preserved with the upgrade.

How can you tell which build you are on?

To check the build you currently have, hover the mouse over the main title text (i.e. “Mail Attachment Downloader”) in the main program window.

version and build

You should see a popup with the version eg. 3.2 and the build 3.2.955.0 (955 is the build) as shown above.

How do you enable rule tracing?

It’s easy, just go to the Global filters tab and check the Rule Tracing checkbox (see the red text box highlight).

rule tracing

The search icon next to the Rule Tracing checkbox will not show anything until you run a Connect And Download session.

IMPORTANT: Before running a trace…

To make sure the program has a chance to process all email, do the following:

  • Uncheck the Exclude inline attachments checkbox inside every Global Rule that has the control enabled
  • Go to Global Filters tab -> Search in ->
    • Select Messages Since Last Download radio button if you are SURE there is new email that meets the criteria
    • Select All mail radio button to scan all email from the start of time. The program will then scan all email (this setting will apply for every account).
  • Check the Inline content button

Running a trace…

Once you have enabled rule tracing, you will need to run a connect and download to test it out.

But before we proceed, a little advice for PRO Server service users follows…

  • If you are running the PRO Server and a service, uninstall the service  first so you can troubleshoot the issue using a normal connect and download.
  • If you are having troubles with the service itself and the connect and download is working fine here’s what to do. The most likely cause for this is that you have not uninstalled and re-installed the service from within the program after changing some configuration. Config changes only take effect in the service after uninstalling and re-installing the service from within the program’s service tab.

Before running a connect and download, we recommend setting up the rules so you focus on the problematic email or attachment. To do so, you may need to disable certain rules (right click and disable them).

Or you may need to change the Search criteria (Search in… section) to All mail and alter the dates (Search between dates… section) when you want the program to process emails.

This way when you run the connect and download we won’t process all emails again but will just focus in on the specific email or attachment you want to troubleshoot.

Now click Connect and Download to initiate the trace and let it finish.

Analyzing the trace…

Once the connect and download has finished, switch back to the Global filters tab. Then click the Search button small search button next to the Rule Tracing checkbox.

This should bring up a popup window something to the effect of the below.

Email Attachment trace view

Now lets look at how to analyze the information presented in this window.

Step-1: Select the download session based on time shown that you want to analyze.

Trace view - step 1

Step-2: Select an email that should have downloaded emails or attachments or should have run rules or actions and you think there’s an issue with it.

Trace view - step 2

Step-3: Look at every part or attachment of the email and drill down into which rules ran and which rules matched or did not match and why.

Trace view - step 3

That’s it!

NOTE: Rules are run ordered from top to down (in the order they show up in the Global filters tab). So if a rule matched, no more rules under that rule will run.  You can change the ordering in the Global filters tab by dragging and moving a rule around.


With this you should be able to find out why one or more rules did not download any attachments. And then you should be able to tune the rule configurations to ensure that it does what you want it to do.

Process email and attachments – tips and tricks

Processing emails or attachments to folders is easy with the Mail Attachment Downloader PRO Client and PRO Server products.  

The feature table on the PRO page provides all functionality available within the product. This post dives into many of those PRO functions to help you automate mundane workflows in your business away. You can click through each of these functions being highlighted here to then dive into those functions in more detail. 


Global Filters and Phases

A key function of PRO functionality is the concept of Global Filters. Global filters lets you configure one or more rules to run every time an email or attachment in an email is processed.  

The program runs through every rule (top down) for every email (if Save as .eml checkbox in the rule is checked) and every attachment. When a rule matches an email or an attachment, the email or attachment is saved, data is extracted using extraction rules and then actions in that rule are run.

Each rule has four phases:

  1. The search phase defines criteria that tells the program whether or not to run this rule.
  2. The extract phase enables you to extract data from the email or attachment and also transform that data as needed.
  3. The save phase saves the file based on the supplied templated filename and folder. You can also use extracted information in the path giving you full control with the directories or filename of the saved file.
  4. And the process phase enables you to run many different actions to automate the workflow.

For more on this, refer to:

Rule Tracing How-To: Troubleshoot rules like a PRO

Troubleshooting Global filters has never been easier. Use Rule Tracing like a PRO to troubleshoot why your global rule filter did not work the way you thought it would.

If you still have questions or issues, see instructions here for contacting support.


Mail server connection setup tips

Links below will help guide you with mail server settings setup.

Still having connectivity or authentication problems? Here are a few tips:

    • Firewall or some antivirus can often prevent the program from directly connecting or authenticating with mail servers. We do not have guidance here for every firewall or antivirus vendor, so check with their documentation and/or contact your IT support to get past this.
    • Search our Knowledge Base for connectivity issues and how to solve them (eg. adding proxy settings in the program)

License activation or moving licenses

    • PRO license activation problems: Search our Knowledge Base for activation tips.
    • Moving license: Moving license from one system or account to another is easy. Just uninstall the program from the old system and move to the new one. You should be able to use the program on both the old and new systems for a short-period (~ a day).

Running for multiple accounts

This blog post explores how you can setup the program to run for multiple accounts simultaneously. This feature is only available in the PRO editions.

READ THIS
https://gearmage.com/blog/multiple-email-accounts-via-rules/

multiple accounts


PDF tips: Save emails or attachments as PDF

With the ability to convert emails to over 50+ formats, saving emails or emails with attachments in a single file or to different formats is a breeze with PRO Server. Note that PRO Client does NOT support converting to multiple formats.

READ THIS
https://gearmage.com/blog/convert-email-attachments-to-pdf/

Convert to PDF
Convert to PDF

Extract data like the Invoice number from an email

You can extract any data using the extraction wizard from the email or body and then use that in the saved filename format.

READ THIS
https://gearmage.com/blog/extract-data-emails-attachments/

extractions-wizard


Save extracted data to a database

Saving extracted data or files to a database could never be easier with the PRO Server.

READ THIS
https://gearmage.com/blog/save-emails-and-attachments-to-a-database/


Nest rules and actions like a PRO

You can nest both rules and chain/nest actions so one is run after the other with the PRO Server.

  • Nest actions (see below)

For example, unzip an email attachment, then run some other actions on the extracted data.

READ THIS
https://gearmage.com/blog/email-actions-unzip-convert-pdf-run-script/

nest actions

  • Nest rules (see below)

Nesting rules can help with reusing rules so you don’t have to repeat the same condition across many rules.

Nesting email rules and actions

Further reading

Some interesting how-to links and posts for further exploration:

Contact us

Contact us if you have any questions, suggestions about the functionality described in this article.

New Filter Features in PRO Server v3.2 build 978

Mail Attachment Downloader PRO and PRO Server editions offers email filters to configure the program to process emails and attachments in different ways.

This gives an introduction to Global Filters and explores some of the new features introduced in  PRO Server v3.2 build 978.

Overview

For an overview of how to save emails and attachments in specific folders please refer to this post before reading through this one.

What are global filters?

The global filters are a set of rules you can create in the Global Filters tab as shown below. This is only available in the PRO and PRO Server editions of the product.

Global filters apply to all configured accounts in the program (under the Account dropdown).

Note that to download from multiple accounts, you must pick ‘multiple@multiple’ from the Account dropdown. Otherwise the download will only run for a single account.

When is a global filter run?

For each attachment, a global filter is run to see if any filters you have specified within match that particular attachment.

How to make a Global Filter apply to a single account?

By default, global filters run for all selected accounts (when you select multiple@multiple from the Account dropdown in the main window).

You can make a global filter apply only to a specific account by editing the rule and then clicking Add -> Filters -> Account filter as shown below.

Screen Shot 2017-04-27 at 1.55.35 PM

This will make that rule run only for that account. Once you have clicked Save, this will also show up in the main list.

Moving rules

Each rule is run for every attachment from top down until a matching rule is found. The ordering of the rules in the global filters tab is important.

Once a matching rule is found for a specific attachment or body, then NO other rule is run for that attachment or body. If the email has other attachments, then all rules are checked again.

To move one or more rules, just drag and drop the rule or rules in the Global Filters tab.

Catch all rule, send auto-response

If you want certain attachments to be processed, then define global rules for those. But what if none of them matched?

Since filters in the global filters are run top down and ordering matters, you can now define a catch all rule towards the end of the global rule filters list.

This last rule will run when none of the rules above it have resulted in a successful match or download.

That way, you can, for example, send an email to the sender indicating that their email did not contain the requested attachment or data.

Enable / Disable specific rules

You can now enable or disable specific global filter rules. Just go to the global filter tab and then right click on one or more rules and then Enable or Disable them. Disabled rules will never run.

Setting download dates

The program starts downloading messages from an account from the start of time if it had never run a download from that account before. This is true even when Messages since last download was checked in the Search or Global Filters tab.

Screen Shot 2017-04-27 at 1.58.00 PM

If you want to change this behavior, you can set a Start Date above and also switch to Messages since last download in the Global filters tab.

What this does is that for each account selected in the Account dropdown (or multiple accounts when using multiple@multiple selection), the program will only download messages from that start date onwards and will only check for new messages that have not been downloaded or processed by the program.

Further reading

Some interesting how-to links and posts for further exploration:

Contact us

Contact us if you have any questions, suggestions about the functionality described in this article.

Global Filters – a complete walkthrough

With this post we will explore how you can save emails and attachments to folders using email rules.  Mail Attachment Downloader PRO and Free versions offer excellent functionality to solve these specific needs.

In our earlier blog post, we explored the many ways the PRO products can help you save time and money by getting data out of  emails.

The free version is for personal or trial use and offers some basic functionality to automatically save email attachments to folders.

The free version offers saving email attachments to a single folder. The PRO versions offer the ability to save not just the attachments but also entire emails to one or more folders.

The PRO Server also lets you run these tasks 24×7 unattended on a Windows Server or Azure cloud setup with ease.

Save emails and attachments to folders

The overall concept to save specific emails to distinct folders using our PRO Versions is to create different global rule filters, one per save location.

With each rule filter you would specify which emails to select for that specific rule filter and also specify a save location and filename.

Global Filter Rules overview

A key function available only in the PRO products is the concept of Global Filters.  The Global filters tab offers the ability to create and manage more than one rule.

The rules are run top-down for each download session for the account selected in the Account section in the main program window. You can re-order rules as described in the tips below.

Global filters lets you configure one or more rules to run every time an email or attachment in an email is processed.  Each rule has four phases:

  1. The search phase defines criteria that tells the program whether or not to run this rule.
  2. The extract phase enables you to extract data from the email or attachment and also transform that data as needed.
  3. The save phase saves the file based on the supplied templated filename and folder. You can also use extracted information in the path giving you full control with the directories or filename of the saved file.
  4. And the process phase enables you to run many different actions to automate the workflow.

The blog post will cover each phase separately below.

Rules Tips and common questions

  • Restrict a rule to just one email account: By default, rules aren’t restricted to any one email account: the same rule will run for any selected email account. If you want a rule in the Global filter to only run for a specific email account, you can do so as follows: In a rule (add new filter or edit selected filter), click on the Add -> Filters -> Account matches filter selection and then pick the account  from the dropdown and Save. Do this for each rule you want to restrict to that account.
  • Run rules for multiple accounts: The rules in the Global filters tab is run for the account selected in the Account dropdown in the main window. To run the rules across many accounts, select multiple@multiple in the Account dropdown and then choose the accounts you want to run for. This will run all the rules every time for each selected account.
  • Rules run per attachment / body: For every attachment and/or every body, the program will try to match every rule. Once a match is found, no other rules are run for that attachment or body. Note that other attachments in the email may match other rules based on the filters you have specified in the account.
  • Re-order rules (drag and drop): Rules are run top-down and ordering is important. You can re-order rules by dragging and dropping the rule to the order you want. If an email or attachment matches all filters defined inside the rule, then subsequent rules are not run for that email or attachment.
  • Clone or nest rules: If you find yourself creating many similar rules, an easy way to do this is to select a rule in the Global filters tab and then either double click or click on Edit selected filter. Then change the name of the filter to something different, click Save and choose No in the subsequent popup. Alternatively and this is recommended if you have a lot of rules, you can nest rules instead of copying them.

Create a rule with some filters

Create + Add new filter in the Global filters tab to create a new rule filter as shown earlier. In the rule filter, specify a name for the filter first.

Tips with naming

It is important that you name the rules in such a way that they are easy to find when creating many rules. Choose useful names when naming rules.

Lets say you are running a rule named “Invoices” but you are running this for only one account so you have added a Account matches filter in that rule, then it would be ideal to name the rule “someaccount@gmail.com – Invoices” so it is clear that this rule only applies to someaccount@gmail.com.

Then when you edit the filters in the Global filters, you can search for “someaccount@gmail.com” and only those rules that apply to someaccount@gmail.com will show up.

Search phase

The search phase lets you specify the criteria that’s used to match this rule. The rule will only save the email or attachment and process actions if the criteria matches. Otherwise, the rule is skipped.

Now let’s add a filter to determine which emails to save. In the example below we will filter based on the Subject.

Once the Subject filter is added, you can specify terms such as those containing certain phrases like  ‘Payments’ OR ‘Invoices’.

subject filter added

By specifying OR, the program will search for any emails with Payments or Invoices occurring anywhere in the Subject of the email and execute this rule.  You can also specify AND to ensure one or more terms all are included in the Subject (anywhere in the Subject). Or you can specify NOT to exclude certain emails.

Extract phase

You can also add field extractions enabling you to not only extract data but also transform data and then save them into fields enclosed within curly braces { } (eg. {ORDER_NO}).

extract data - two ways

For more on this, refer to this blog post that’ll go over extraction in more detail.

Save phase: Pick the save location and format

Pick the Save folder and the Saved filename format.

IMPORTANT
In the Save Folder, make sure you are using UNC paths and not mapped network drives when using the PRO Server product. 

Note that the Saved filename format can also include data from the emails like the {ID} or {SUBJECT} or {FROM} or {TO} or {DATE} an extracted field such as {ORDER_ID} and you can include these in the filename.

IMPORTANT
Use {ID} in the filename format:
{ID} is the unique ID given for each file. Ensure {ID} is always present in the saved filename format. Since the program uses multiple threads to download emails and attachments, removing {ID} will cause the program to fail when different emails have the same filename (this happens more often than you think as all email bodies are just named body.eml so if you do not include {ID} then you’ll just get one body.eml file and it would not work as desired).  

You can also specify \ to automatically create a folder based on say the {ORDER_ID} as shown below FY2016-Q3\{ORDER_ID}\{FILENAME}_{ID}{EXT}.

madpro3_saveemailbody

You can also create directories based on who the email was from like in the Free version. All you have to do is to specify something like: {EMAIL_FROM}\{FILENAME}_{ID}{EXT}. This will automatically create a directory for each FROM.

Similarly you can specify {EMAIL_SUBJECT}, {EMAIL_TO}, {EMAIL_CC} and many more. For a full list of options in the program, click the little (i) icon to the far right of the Saved filename format text entry. From the popup you can double click the field you would like to insert into the text area at the current cursor position.

We always recommend adding the {ID} to the filename ensure that files are saved with distinct names even if the name of the files are the same.

You can also save the email (Save as .eml checkbox) that will save the entire email as well instead of just the attachments.

Process phase: Perform actions after save

You can also then perform various advanced actions for each rule after the file is saved. The feature table on the PRO page provides a list of all supported actions and help for each one.

Some examples of actions:

  • Archive emails for further processing
  • Receive invoice data via email and need to save data for invoice processing
  • Save emails and integrate with ERP, EDI, eDMS, eCMS, document management systems or content management systems, eInvoicing invoicing software, Salesforce or medical systems
  • Use our PRO SDK (Software Development Kit) to integrate directly with your LOB applications.
  • Save emails or Excel or CSV attachments sent via email to an in-house or cloud database for further processing
  • Convert emails to PDFs or multi-page TIFF or over 50+ formats or merge/split PDFs including attachments to hand-off to other document management systems or medical software
  • Run custom in-house scripts after extracting attachments
  • Auto-respond or send email notifications when certain types of emails or attachments arrive and then take other actions

Create multiple rules for different folders

Create multiple rules to match different emails and save them to different folders.

Uses and scenarios

Many businesses today use legacy extraction products to get data out of emails into folders (magic folders). Various other backend processes then pick up these files automatically to process them such as Scanning products, Invoice processing or invoicing related products, Document indexing products, Document archiving/management products,  OCR products and many more.

Further reading

Some interesting how-to links and posts for further exploration:

Contact us

Contact us if you have any questions, suggestions about the functionality described in this article.

Save csv, excels to a database

If you have a need to save csv or excels to a database, you can automate it with ease with Mail Attachment Downloader PRO Server.

If you already receive these csvs or excels on email, then great we will show you how to save these to a database.

If not, you can email these csvs to an email address of your choice and have the program extract the attachment and automatically save it giving great power to you on-the-go.

Save csv, excels to a database

First ensure that you have a database connection configured as instructed here.

The next step is  to create a Global rule filter so we can first identify the email that contains the csv, excel. You can do so by adding a rule filter as shown earlier in this blog post. You can also specify a file type filter to choose .csv or .xls or .xlsx emails with filtering rules.

Once those are both done, saving the csv or excels to a database requires you to add an action.

  1. Click Add action -> choose Extract csv and save to DB and then click the Load sample file button to load a sample Excel or Csv file.csv to db - load sample
  2. Pick the sheet from the Choose sheet dropdown you want to load data from.csv to db - sheet
  3. Click the Load column names from sample file button. This will load the column names as cell id’s (eg. A1, B1 etc.).csv to db - load columns
  4. If your Excel/Csv starts from a header row (with header titles for each column), check the Starts from a header row and then click the Load column names from sample file again. This will auto-import the column names for easier manageability.csv to db - load columns with header row
  5. For each column you want to import, specify a field name within {} as shown below. By default all fields are imported as VARCHAR’s. If you want to change the type, you can also choose Extraction Wizard for this field to change the field type or manipulate data from the Csv if needed.Csv to db - field name
  6. Once all fields have been given a name within {}, click the Insert into database tab. Pick the DB source you have already configured and the table name you want the data inserted into.csv to db - table name
  7. Now specify the SQL including fields that you want inserted as shown.INSERT INTO {TABLE_NAME} (‘Sales description’, ‘Sales price’, ‘Sales quantity’) VALUES ({DESCRIPTION}, {PRICE}, {QUANTITY})csv to db - sql
  8. Now click the Test SQL using Sample File button. If everything is correct, then you should see something like the below. You can then look at the database to ensure that the rows from the Excel or CSV were inserted into the DB. csv to db - success

That’s it.

Now any emails matching the criteria would end up being added into the DB.

Further reading

Some interesting how-to links and posts for further exploration:

Contact us

Contact us if you have any questions, suggestions about the functionality described in this article.