Skip to content
Gearmage Logo
  • About
  • Products
    • Mail Attachment DownloaderMail Attachment Downloader Free
    • Mail Attachment DownloaderMail Attachment Downloader PRO
      • PRO Editions and Pricing
      • PRO Rules
      • PRO Parser
      • PRO Backup
      • PRO SDK
    • Gear Doc ConverterGear Doc Converter Free and PRO
    • Photo OrganizerPhoto Organizer Free
  • Use cases
      • Document management
        • Emails into M-Files
        • Emails into DocuWare
        • Email capture into Laserfiche
        • Archive signed DocuSign documents
        • Enterprise email ingestion
      • Extract and transform data
        • Extract, transform and load (ETL)
        • Data from email body text
        • Data from PDF attachments
        • Tables and line items
        • Scanned documents and photos (OCR)
        • E-invoices: ZUGFeRD, XRechnung, Peppol
        • Purchase orders from email
        • Leads from web-form emails
        • Extract data with AI
      • Invoices and documents
        • Invoice and AP automation
        • Invoices into Business Central
        • Print email attachments
        • Convert Word, PDF and Excel files
        • Emails to PDF
      • Cloud storage and SFTP
        • Emails and attachments to SharePoint
        • Emails and attachments to OneDrive
        • Emails and attachments to Google Drive
        • Emails and attachments to Amazon S3
        • Emails and attachments to Azure Blob Storage
        • Emails and attachments to SFTP
        • All cloud storage options
        • Watch SFTP and cloud folders
        • Files from links in emails
      • CRM and contacts
        • Email data into Salesforce
        • Email data into HubSpot
        • Emails and contacts into your CRM
        • Email addresses to a contact list
      • Data and spreadsheets
        • Email data into Google Sheets
        • Emails to CSV or Excel
        • Emails to a database
      • APIs, scripts and AI
        • Send email data to REST APIs
        • Run PowerShell scripts from email
        • Webhooks, ChatGPT and Claude
        • Summarize emails with AI
      • Mailboxes and archiving
        • Outlook emails to a folder
        • Gmail emails to a folder
        • Automated email archival
        • Move email between accounts
        • Alerts when an email doesn't arrive
    • No use case matches . Search all PRO features or ask us.
  • Partner
  • Blog
  • Contact
Mail Attachment DownloaderVersion 4.0Version 3.x

Extract data from emails and attachments – an in-depth guide

Read invoice numbers, totals, dates and line items out of emails and attachments with the PRO Parser, and use them in file names, sheets and systems.

Fields described in plain words, such as the invoice number and the date payment is due, with the AI's answer and how sure it is for the first sample

An invoice number, an order ID, a total, a due date: the values you need are often inside an email or its attachment. Mail Attachment Downloader 4.0 can read them out and use them to name files, fill a spreadsheet, or hand them to another system.

In 3.x you did this with extractions in a rule, using the extraction wizard or a regular expression. In 4.0 there is a better way: the PRO Parser. You show it a value once, and it finds it in the next emails.

This guide covers the Parser first. The older field finders are still there in PRO Rules (the new name for Global filters), and they are covered at the end as the advanced path.

In this post
  1. Fields: where values are kept
  2. Part 1: The Parser (recommended)
  3. Part 2: Fields inside a PRO rule (advanced)
  4. Where you can use the fields
  5. Which edition do you need?

The tool in this guide: Mail Attachment Downloader PRO ParserSee PRO Parser →

Fields: where values are kept

A value the program reads is kept in a field, written in braces, such as {INVOICE_NUMBER} or {ORDER_ID}. You can use a field wherever the program asks for a name or a value: a folder, a file name, a CSV column, a database row.

The email has its own fields too, such as {FROM}, {SUBJECT}, {DATE[yyyy-MM-dd]}, {FILENAME} and {EXT}. The “Fields…” button next to a name box lists them all.

Part 1: The Parser (recommended)

The Parser reads the email’s subject, sender and body, and its attachments: PDF, Word, Excel, HTML, CSV and text files, .eml and .msg files, and e-invoice XML.

Open the Parser tab and click “New parser”. Building a parser takes five steps: “Source”, “Fields”, “Checks”, “Output” and “Run on”.

Start from real samples

In “Source”, pick 3 to 25 similar emails from a mailbox, from “Emails in the backup”, or from “A file”. Similar emails are grouped, so Acme’s invoices sit together and Northwind’s order confirmations sit together. Build one parser for each kind of email.

Four ways to make a field

In “Fields”, each field is found one of these ways:

  • Highlight. Select the value in a sample. The Parser works out how to find it, tries it on every sample and shows a hit rate, such as 3 / 3. Nothing is sent anywhere.
  • Using AI. Describe the value in words, such as “the date payment is due”. The AI finds it and shows where it read it, with how sure it is. A value that isn’t in the text is flagged.
  • Pattern. For values with a fixed shape, such as INV-2026-0423.
  • From invoice data. E-invoices (Factur-X, ZUGFeRD, XRechnung, Peppol, UBL) carry their own data. The Parser reads it exactly, with no pattern and no AI.
Fields described in plain words, such as the invoice number and the date payment is due, with the AI's answer and how sure it is for the first sample
Describe the fields in words. The answer shows each value, how sure the AI is, and that it was found in the text.

You choose the AI. The built-in AI runs on your own system and sends nothing anywhere. You can also use your own AI server, OpenAI, Claude, Gemini or Azure OpenAI; the program asks before anything leaves your system. Tick “Hybrid mode” to use patterns first and ask the AI only for fields they leave empty.

Not sure which fields a sample offers? “Suggest fields and tables” proposes them, and you tick the ones you want.

A Factur-X e-invoice read from its own data: 22 fields such as invoice number, dates, seller name and VAT id, and a table of lines
An e-invoice: 22 fields and the line items, read from the invoice’s own data.

Tables and line items

Invoices and orders are mostly tables. Click “Add a table” and the Parser reads it as rows and columns, in PDFs, HTML emails, spreadsheets and CSV files. It joins a table that runs over several pages and stops at the Total row.

It then checks that the lines add up to the subtotal or total, so a misread amount doesn’t slip through. If no header row fits, “Describe the rows in words” lets the AI read them.

A table of line items with description, quantity, unit price and amount, found on three samples, adding up to the subtotal, and written as one CSV row per line
One table found on three invoices from Acme, Northwind and Fabrikam. Each adds up to its subtotal.

Check the values before they are used

In “Checks”, give each field a check: “Not blank”, “Between” two values, “In a list” or “Not before” a date. You can also check fields together, such as “Subtotal plus tax equals the total”, and skip an invoice that was already parsed.

An email that fails a check, misses a required field, or that the AI was unsure of waits in “Needs you”. Nothing is written, sent or moved for it until someone approves it.

Send the values somewhere

In “Output”, choose where the values go:

  • “CSV file”, “Excel workbook” or “Google Sheets”: one row per email, with the columns you choose. The lines of a table can go to their own sheet, one row per line.
  • “Save files”: save the attachments, the email, or both, in a folder and under a name built from the fields, such as {SUPPLIER}\{INVOICE_NUMBER}_{FILENAME}{EXT}.
  • “Move the email” to a folder of its mailbox when it is done.
  • With PRO Rules Server: “SQL database”, “Webhook” and “Tell me” (a message to Slack, Teams and other channels).

Every output has a Test button. Processing the same email again replaces its row instead of adding a second one.

Turn it on, then keep an eye on it

In “Run on”, choose the accounts and see which recent emails the parser would pick. Save it, and it runs with each download.

The parser’s “Results” list every record it has read. Use “Export CSV” or “Export JSON”, or “Process again” from the kept copies without downloading anything. “Health” warns you when a field is found less often than usual, which often means a sender changed its layout.

The Results of a parser: received date, sender, invoice number, supplier, due date and total of each email it read
Results: every value the parser read, ready to export.

Part 2: Fields inside a PRO rule (advanced)

A parser is saved as a PRO rule, so with PRO Rules you can open it in the Rule Editor and add your own steps after “Run Parser”.

You can also find a field directly in a rule. This suits a quick, one-off value. For many similar emails, the Parser is the better choice.

Open the PRO Rules tab and open or create a rule. Set “Which emails” first, such as From contains acme.example and Subject contains Invoice. Then, under “Fields to find”, click “Add a field” and choose how the field is found.

With AI (PRO Rules Client and up)

Say in plain words what to look for. You set the type, a check, and what happens if a value is not found. One AI call fills all the fields of an email.

The Fields found with AI window: invoice number, due date and total including tax, each with a type, a check and what the AI reads
Fields found with AI, inside a PRO rule.

By pointing at it: the extraction wizard (PRO Rules Server)

Paste or load a sample, highlight the value and click “Use the highlight”. Then fine-tune it on five tabs:

  • “Where it starts”: the text before the value, such as Payment total: USD.
  • “Where it ends”: at the end of the line, before certain words, or after a number of characters.
  • “Change it”: remove spaces, change case, or turn it into a number.
  • “Check it”: for example, it must not be empty.
  • “When it fails”: use a default, or skip the rule for this email.
The extraction wizard finding the total 249.99 after the text Payment total: USD in a sample Acme invoice
The extraction wizard: “It finds: 249.99”.

By pattern (PRO Rules Client and up)

This is for people who know regular expressions (.NET style). Say the subject is “Invoice INV-2026-0423 from Acme Office Supplies”:

  • “Look in:” Subject
  • “Pattern:” ^.*Invoice (INV-\d{4}-\d{4}).*$
  • “Replace with:” $1

^ and $ are the start and end of the subject, .* is any text, and the part in brackets is the invoice number. $1 keeps only that part. Type a subject in “Try it on:” to check the result, or click “Pattern help”.

Values inside an attachment

To read a value from a saved file rather than the email, add the “Find fields in the file” step under “Then”. Steps run in order, so only steps below it can use its fields.

Where you can use the fields

Once a field has a value, use it in the rule’s save folder and file name, and in its steps. Click “Fields…” to insert one.

The Save step of a PRO rule: the save folder and file name built from fields, with an example of the resulting path
A rule’s save folder and file name, built from fields, with an example of the result.
  • PRO Rules Client: “Move or copy the email”, “Copy file”, “Upload to cloud”, “Send to document management”, “Add a row to a spreadsheet”, and “Convert documents” to PDF.
  • PRO Rules Server: “Send an email” (in the subject, recipients or body), “Save to a database”, “Store CSV / SQL”, “Run a script”, “Run a command line”, “Web hook”, and conversion to other formats.

Which edition do you need?

  • PRO Parser: the whole of Part 1, with CSV, Excel and Google Sheets output and file names from any field. Includes PRO Backup.
  • PRO Rules Client: adds the Rule Editor, fields by pattern or with AI, and steps after the parser.
  • PRO Rules Server: adds the extraction wizard, databases, webhooks, scripts and the 24×7 Windows service.

The Free edition saves attachments and emails with a fixed choice of names; it doesn’t read values. Every PRO edition has a 30-day money-back guarantee. See pricing.

Mail Attachment Downloader

PRO Parser: read invoices out of your email

Invoice numbers, suppliers, totals and line items from emails, PDFs and scans, into Excel, Google Sheets or CSV. No code.

See PRO Parser →Download free

Free edition for personal use. Every PRO edition has a 30-day money-back guarantee.

Related

  • PRO Parser: read values out of invoices, orders and reports
  • Extract data using a Parser
  • Extract tables and line items
  • E-invoices (Factur-X, ZUGFeRD, XRechnung, Peppol, UBL)
  • Extraction wizard
  • Invoice emails for invoice processing software
  • Emails to CSV and Excel

Questions or ideas about extracting data? Contact us.

Share this:

  • Share on Facebook (Opens in new window) Facebook
  • Share on X (Opens in new window) X

Like this:

Like Loading…

Related

Author gearmagePosted on November 21, 2017December 2, 2026Categories AI, Data extraction and invoices, Mail Attachment Downloader, TipsTags extract data, extract data from email, extract data from email attachments, transform data

Post navigation

Previous Previous post: Process email and attachments – tips and tricks
Next Next post: Why did my rule not download the attachment or email?

Pinned

  • What’s new in Mail Attachment Downloader 4.0
  • Global Filters (now PRO Rules) – a complete walkthrough
  • Save email attachments to SharePoint, OneDrive, S3, Dropbox or Google Drive automatically
  • Save emails and attachments to a database
  • Download emails for invoice processing
  • Extract data from emails and attachments – an in-depth guide
  • How to back up Gmail and Microsoft 365 email to your own system
  • Export emails from Gmail and Microsoft 365 to PST, MBOX, EML or PDF
  • Bulk download emails, attachments and save

Recent Posts

  • Send emails and invoices to your CRM or ERP: Dynamics 365, Business Central, Salesforce and HubSpot
  • Watch folder and process files automatically: SharePoint, S3, Teams
  • Email to webhook: send email data and attachments to an API or Zapier automatically
  • Email attachments to DocuSign automatically: send documents for signature and file the signed copies
  • Save email data to Excel or Google Sheets: one row per email or invoice line
  • Email to DocuWare, Laserfiche or M-Files: file email attachments with index fields automatically
  • Email to Slack notifications: Teams, Telegram and more when attachments arrive
  • Download attachments from a shared mailbox in Microsoft 365 automatically
  • Create email rules with AI: describe what you want, test it, save it
  • Migrate Gmail to Microsoft 365, or any mailbox to another provider

Categories

  • Document Converter
    • Tips
  • General
  • Mail Attachment Downloader
    • Announcements
    • Features
      • AI
      • Alerts and notifications
      • Backup, export and migration
      • Cloud storage and document systems
      • CRM and ERP
      • Data extraction and invoices
      • Databases and spreadsheets
      • Email accounts and sign-in
      • Email security
      • Integrations and automation
      • PDF and documents
      • PRO Rules
    • Getting started
    • Tips
    • Version 3.x
Gearmage Logo

Gearmage develops software and services that save time and money and improve productivity. In business for over 10 years and trusted by businesses worldwide.

Products

  • Gear Doc Converter Free and PRO
  • Photo Organizer Free
  • Mail Attachment Downloader Free
  • Mail Attachment Downloader PRO
  • PRO Rules
  • PRO Parser
  • PRO Backup
  • Mail Attachment Downloader SDK

Company Info

  • About
  • Contact
  • Blog
  • Partner

Top Articles

  • Process email and attachments – tips and tricks
  • PRO features: multiple email accounts and rules
  • Automate emails and integrate applications

© 2026 Gearmage LLC. All Rights Reserved.

  • Terms & Conditions
  • Privacy Policy

All product and company names are trademarks™ or registered® trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.

%d