Save email data to Excel or Google Sheets: one row per email or invoice line

Save email data to Excel or Google Sheets automatically: one row per email or invoice line, read from emails and attachments, never added twice.

To save email data to Excel or Google Sheets, a program has to read the values out of each email and add them as a row. Mail Attachment Downloader does both: its Parser reads the invoice number, the supplier, the total or any other value from the email and its attachments, and adds one row per email, or one per invoice line, to an Excel workbook or a Google Sheet. Process the same email again and its row is replaced, never added twice.

The examples use Contoso’s mailbox finance@contoso.com, the workbook \\fileserver\Finance\Invoices.xlsx, and invoices from Acme, Northwind and Fabrikam, such as INV-2026-0412.

Three ways to get email attachments into a spreadsheet

  • The Parser’s outputs: the easiest. You show the Parser which values to read, then turn on Excel workbook or Google Sheets. The lines of an invoice table can get a tab of their own.
  • The rule step Add a row to a spreadsheet: a row for each email a PRO rule picks, with any fields the rule has: the sender, the subject, the date, or values its steps found.
  • Save metadata: a CSV file of the email’s details for each saved file, which Excel opens. The simplest log.

What you need

Parse email to Excel with the Parser

  1. On the Parser tab, click New parser and add a few sample emails, such as one invoice each from Acme, Northwind and Fabrikam.
  2. In the Fields step, mark the values: highlight the invoice number in a sample, or describe it in plain words and let the AI find it. See Extract data from email with AI.
  3. In the Output step, choose One record for each: email, or attachment named (such as order_*.pdf) for a row per attachment.
  4. Turn on Excel workbook. Enter the Workbook (.xlsx), such as \\fileserver\Finance\Invoices.xlsx, and the Sheet (empty: the parser’s name).
  5. Under Columns, give each column a Heading and a Value (fields in braces), such as “Invoice number” and {INVOICE_NUMBER}. Fields… picks one, and Every field, as at first puts back one column per field.

The CSV file, the Excel workbook and the Google Sheet share one Columns list, so they hold the same columns. The preview on the right shows the row of the sample you’re on.

Parse email to Excel or CSV: the Output step of the Parser for Supplier invoices, one record for each email, the Columns list Invoice number, Invoice date, PO number, Due date, Total and Supplier with fields in braces, a CSV preview of sample INV-2026-0412, and Run it again and nothing doubles
The Output step: one Columns list for the CSV file, the Excel workbook and the Google Sheet.

Before you turn it on, click Test on the card, then Try the write on a temporary copy: it writes into a copy of the workbook, shows it, and deletes the copy. Your workbook is only read.

The Parser's Output step for Supplier invoices: the Excel workbook card on, writing to \\fileserver\Finance\Invoices.xlsx with four columns and the table lines on their own tab, and the Google Sheets card on with the Finance Google Drive connection, with a preview of each row on the right
The Parser’s Output step: the same row to an Excel workbook and a Google Sheet, and the invoice lines on a tab of their own.

Save email to Google Sheets

Google Sheets is reached through a Google Drive connection you make once with your own Google Cloud app:

  1. In the Google Cloud project of that app, enable the Google Sheets API as well as the Google Drive API.
  2. Add the connection in Settings › Sources › Cloud Connections. Save email attachments to SharePoint, OneDrive, S3 or Google Drive shows how.
  3. In the Google Sheet, add the tab the rows go to.
  4. In the Parser’s Output step, turn on Google Sheets, pick the Google connection, paste the Address of the Google Sheet from the browser, and enter the Tab.

The values leave your computer for Google, so the Parser asks first and names where they go. Its Test, Write one test row…, writes to a tab called PARSER TEST, shows it and removes it again. Values go in as plain values: a text that starts with = is never run as a formula.

One row per invoice line

Many invoices are a table of lines. When the parser reads a table, the Excel workbook and Google Sheets cards offer Also write the table lines. The lines go to a tab of their own, one row per line, the email’s key first, so a lookup joins them to the email’s row. Under Repeat on each line, choose The email’s key only, Every field the parser reads (the supplier and the invoice number on each line, ready for a pivot table), or Choose fields….

Email invoice lines to a spreadsheet: the Parser's table lines with columns description, qty, unit and amount read from INV-2026-0412.txt, adding up to the subtotal 416.50, written as one row for each line
A table of invoice lines: written as one row for each line.

Run it again and nothing doubles

Each row starts with the email’s key (its account and message), kept in the first column. When the same email is processed again, after you correct a value in Needs you or with Process again…, its row is replaced, and its invoice lines are replaced where they were. Other emails’ rows are not touched.

A value is a number only when it is plain digits, so an invoice number like 00123 keeps its zeros.

Add a row to a spreadsheet in a PRO Rule

With PRO Rules Client or PRO Rules Server, any rule can add a row:

  1. On the PRO Rules tab, click New rule… or Edit, and set Which emails, such as the sender’s domain acme.example.
  2. Under Then, click Add a step…, open Data and fields and double-click Add a row to a spreadsheet.
  3. In Where the rows go, choose An Excel workbook (.xlsx) or A Google Sheet.
  4. Enter the Workbook file, or address of the Google Sheet, and the Sheet or tab (Parsed to begin with). A Google Sheet also needs its Google connection.
  5. Under Columns, click Add a column for each one: a heading and a value such as {FROM}, {SUBJECT}, {DATE} or {TOTAL}.

The step adds one row for each email, after the email is processed. For values from inside the attachments, put Find fields with AI or Find fields in the file before it.

Email attachments to spreadsheet: the Add a step window with Data and fields chosen, showing Find fields in the file, Find fields with AI, Look up from a database, Save to a database, Store CSV / SQL, Save metadata, Fill a template, Run an AI prompt and Add a row to a spreadsheet
Add a step › Data and fields › Add a row to a spreadsheet.
Mail Attachment Downloader's Add a row to a spreadsheet step: rows go to the Excel workbook \\fileserver\Finance\Invoices.xlsx, sheet Invoices, with the columns From, Subject, Received and Total from the email's fields, once per email
Add a row to a spreadsheet: one row per email, replaced if the same email comes again.

The simplest log: Save metadata to a CSV file

If you only need who sent what and when, the Save metadata step adds a line for each saved file to a CSV file, with the email’s details: the file’s name, the sender, the recipients, the subject and the date to begin with. Tick Add to the file when it is there (otherwise replace it) to keep one running log, and open it in Excel.

The Save metadata step in the Rule Editor for Supplier invoices: a CSV file in the save folder with the columns file name, original file name, from, to, CC, subject and date, Add to the file when it is there ticked, Run For each saved file
Save metadata: a CSV line for each saved file.

The other way round: Excel attachments into a database

Receive a daily sales report as an Excel or CSV attachment? With PRO Rules Server, the Store CSV / SQL step reads its rows and adds them to a database table. See Save CSV and Excel attachments to a database.

The Store CSV / SQL step for Fabrikam daily sales: data source Contoso Finance, table dbo.SalesLines, an INSERT statement, and the columns Description, Price and Quantity read from the sheet Daily sales of an .xlsx sample file
Store CSV / SQL: the rows of an Excel attachment into a table.

Questions people ask

Can I save each email to Google Sheets automatically?

Yes. Each email the parser or rule picks adds a row as it is downloaded, on the program’s schedule or as soon as new email arrives.

Does Excel have to be installed?

No. The program writes the .xlsx file itself. Keep the workbook closed in Excel while downloads run: a workbook that is open can’t be replaced, and the step fails until it is closed.

Can I get one row per attachment instead of per email?

Yes, in the Parser: set One record for each to attachment named, such as order_*.pdf.

What leaves my computer?

Nothing for an Excel workbook or a CSV file. For a Google Sheet, the values in the row go to Google, through your own Google app.

Try it: download Mail Attachment Downloader and start with the free edition, or compare the PRO editions, each with a 30-day money-back guarantee.

Related

Questions about this post? Contact us.

Detect spoofed invoice emails with SPF, DKIM, DMARC and look-alike domain checks

Detect spoofed invoice emails automatically: check SPF, DKIM and DMARC results and look-alike domains, save invoices that pass and flag the rest.

To detect spoofed invoice emails automatically, check who really sent each one before its invoice is saved. Mail Attachment Downloader’s Email security condition reads the SPF, DKIM and DMARC results your mail server wrote into the email, and spots look-alike domains such as acrne.example for acme.example. A rule then saves only the invoices that pass, and sends the rest to a review folder with a notification.

Fake invoices and “our bank details have changed” emails are a common way to steal money from a business. They look like they come from a supplier you know. This post shows how to stop them from slipping into your invoice folder, spreadsheet or accounting system unseen. The examples use Contoso’s mailbox finance@contoso.com and invoices from Acme, Northwind and Fabrikam.

What does the Email security condition check?

You turn on the checks you want. An email passes when it passes all of them:

  • Authenticated: the SPF, DKIM and DMARC results. Choose SPF, DKIM or DMARC passes, or one of them alone: DMARC passes, DKIM passes or SPF passes.
  • Display name: Must not show a different address than the real sender. This catches “billing@acme.example” written in the name of an email that really comes from somewhere else.
  • Reply-To: Must be on the same domain as the sender. A reply to a fake invoice shouldn’t go to a stranger’s mailbox.
  • Look-alikes: the domains you trust, separated by commas. A sender whose domain looks like one of them does not pass: letters swapped, dropped or added, “rn” for “m”, or a zero for an “o”.

The program doesn’t redo the mail server’s checks: it reads the results the receiving server wrote into the email’s headers. A pass shows the sending domain is genuine, not that the email is safe.

Mail Attachment Downloader's Email security condition on the rule Supplier invoices: Authenticated DMARC passes, the display name must not show a different address, Reply-To on the sender's domain, and the trusted domains acme.example, northwind.example and fabrikam.example for the look-alike check
The Email security condition: DMARC, display name, Reply-To and look-alike domains in one place.

Which result should you ask for: DMARC, DKIM or SPF?

DMARC passes is the strictest. DMARC ties the check to the domain in the From address you see, which is the one a fraudster fakes. Ask for it when your suppliers’ domains publish a DMARC policy.

SPF, DKIM or DMARC passes is the default and the safer start: a supplier without DMARC still passes when SPF or DKIM does. Add Look-alikes to it, because a fraudster can make SPF and DKIM pass for a look-alike domain they own.

What you need

  • PRO Rules Client for the Email security condition and moving emails on the mail server.
  • PRO Rules Server for the Send notification step and running as a Windows service.
  • Windows: Windows 10 or later, 64-bit, on a PC, a server or a cloud VM.

Step 1: Save invoices only from senders that pass

  1. On the PRO Rules tab, click New rule… and name it “Supplier invoices”.
  2. Under Which emails, click Add a condition and add the invoices: “invoice” in the subject, or the account finance@contoso.com.
  3. Click Add a condition again and choose Email security. Set Authenticated, tick Display name and Reply-To, and type your suppliers’ domains in Look-alikes: acme.example, northwind.example, fabrikam.example.
  4. Leave Picks on Emails that pass the checks.
  5. Under Save, save the attachments to \\fileserver\Finance\Invoices.
The Rule Editor's Which emails section with the Add a condition button and conditions such as Mailbox folder, Received on or after, Received before, Account and an Any of these group of From and Subject
Which emails: add the Email security condition with Add a condition, beside the rule’s other conditions.

No result decides what happens to an email whose headers have no SPF, DKIM or DMARC result. Some accounts, such as POP3 accounts, don’t add any. For invoices keep Count the email as not passed, so an unchecked email goes to review instead of straight through. Tick Subdomains must match too if a Reply-To on another subdomain of the sender’s domain should fail as well.

Step 2: Send failures to a review folder and a notification

Make a second rule, “Suspicious invoices”, with the same conditions, but set Picks to Emails that do not pass the checks. The two rules never pick the same email.

  1. Under Save, choose The email only and a folder such as D:\Finance\Review, so the reviewer has a copy.
  2. Under Then, click Add a step…, open Email and add Move or copy the email. Pick the Account and a Folder such as “Invoice review”. The email leaves the inbox, so nobody pays it by mistake.
  3. Add Send notification from Notify, and pick a channel: Microsoft Teams, Slack, email or another one set up under Settings › Sources › Notification Channels. Put {FROM} and {SUBJECT} in the message so the team sees which email it is.
The Move or copy the email step in the Rule Editor: account ap@contoso.example, folder Processed invoices, Leave a copy in the original folder ticked, Run Once per email, and List the folders
Move or copy the email moves an email to another folder of its mailbox. For a review folder, untick Leave a copy.
The Add a step window with Notify chosen: Send notification, which tells you in Teams, in Slack, by email or through a web hook
Add a step › Notify › Send notification tells the team about a suspicious invoice email.

Test the checks before you trust them

Click Test this rule… and Run test. The rule runs on your recent emails without changing anything, and each email that fails says why, such as Skipped: not authenticated or Skipped: look-alike domain.

Have a suspicious email saved as a file? Test an email file… tries the rule’s Email security conditions on an .eml or .msg file, with no mailbox, and shows each check as passed or not. Use the email file as it was received: an email forwarded as an attachment has usually lost its authentication results.

The Test rule window: accounts and folders of ap@contoso.com, a list of tested emails from Acme Billing, Northwind Traders and Fabrikam Purchasing with their results, the reasons for the selected email, and the buttons Run test, Open in trace viewer and Test an email file
Test this rule shows what the rule would pick and why. Test an email file… tries the Email security checks on a saved email.
Test rule Supplier invoices: three invoices Matched, one from billing@acrne.example Skipped: look-alike domain, one Skipped: not authenticated, and the trace showing acrne.example resembles acme.example
Test the rule first: the look-alike sender acrne.example is skipped, and the trace says why.

Once the rules run, tick Rule tracing under the PRO Rules tab’s Diagnostics to record each check of each email.

More invoice fraud protection: checks on the invoice itself

A genuine supplier’s mailbox can be broken into, and then its emails pass every sender check. So check the invoice too. With the Parser (PRO Parser and up), reading invoices from email, add these on its Checks step:

  • Duplicates: tick The same, pick the invoice number and the supplier, and choose Skip it and note it or send it to review. The same invoice sent twice isn’t paid twice.
  • Bank details you don’t know: give the IBAN field the check In a list, with the IBANs your suppliers gave you, written as the invoices show them, and Send to review under If it fails. An invoice asking you to pay a new account waits for a person.
  • Unusual amounts: give the total a range with Between.

An invoice that fails waits in Needs you, and nothing is written, sent or moved for it until someone approves it. E-invoices (Factur-X, ZUGFeRD, XRechnung) carry the IBAN in their own data; for PDFs, build an IBAN field by highlighting it on a sample.

The Parser's Checks step for supplier invoices: a Between 0.01 and 100000 check on the total that sends it to review, the sum checks, a duplicate check on invoice_number + supplier set to Skip it and note it, and the review queue settings, with 3 samples passing
Parser checks against invoice fraud: a range for the total and the duplicate-invoice check. An IBAN field takes the In a list check the same way.

For suppliers that bill on a schedule, Expected emails (PRO Rules Client and up) also tells you when an invoice that should have come hasn’t.

What it doesn’t do

  • It isn’t a spam filter or a virus scanner. It decides what your rules save and where, by who really sent the email.
  • It reads the authentication results your mail server added; it doesn’t look up SPF or DMARC records itself.
  • It doesn’t replace a call to the supplier. When an email asks you to change bank details, confirm on a phone number you already have.

Questions people ask

How do I check the DMARC result of an incoming email?

Your mail server writes it into the email’s Authentication-Results header as dmarc=pass or dmarc=fail. The Email security condition reads that header for you, and Test an email file… shows it for a single saved email.

What is a look-alike domain?

A domain made to be mistaken for a real one, such as acrne.example for acme.example, or acme.co for acme.example. Fraudsters register them so that SPF and DKIM pass. The Look-alikes check compares the sender’s domain with the domains you trust.

Can a spoofed invoice pass SPF, DKIM and DMARC?

Yes, when it is sent from the supplier’s own hacked mailbox, or from a look-alike domain the fraudster owns. That’s why the look-alike check and the Parser’s checks on the invoice belong next to the authentication check.

What if my emails have no authentication results?

Then No result decides. Count them as not passed to send them to review, or as passed and rely on the display name, Reply-To and look-alike checks.

Try it: download Mail Attachment Downloader and start with the free edition, or compare the PRO editions, each with a 30-day money-back guarantee.

Related

Questions about this post? Contact us.

Extract data from email with AI: ChatGPT, Claude, Gemini or a local model

Extract data from email with AI: name invoice fields in plain words, read them with a local model, ChatGPT, Claude or Gemini, and review doubtful values.

To extract data from email with AI, you say in plain words what to look for, such as “the invoice number” or “the date payment is due”, and an AI reads it out of each email and its attachments. Mail Attachment Downloader does this in its Parser, with a built-in AI that runs on your own system or with your own OpenAI (ChatGPT), Anthropic Claude, Google Gemini or Azure OpenAI account. It shows where each value was read and how sure the AI is, and holds doubtful emails for you to check.

The examples use Contoso’s mailbox finance@contoso.com and invoices from Acme, Northwind and Fabrikam, such as INV-2026-0412.

How does AI data extraction from email work?

  • You name the fields in words: “The invoice number”, “The supplier’s name”, “The total to pay”. No patterns, no templates per supplier.
  • One AI call per email: the AI reads the subject, the sender, the body and the text of the attachments (PDF, Word, Excel and text files) and fills all the fields at once.
  • Each value is checked against the text: you see where it was read and how sure the AI is. A value that isn’t in the text is flagged.
  • The values become fields: {INVOICE_NUMBER}, {TOTAL} and the others name files and folders, and go to CSV, Excel, Google Sheets or a database.

What you need

Local AI or ChatGPT, Claude and Gemini: choose the AI

The AIs are set up once in Settings › Sources › AI Providers; each parser and step then picks one. Edit… opens a provider: its Key, its Default model (Refresh list asks the service which ones it has), Make this the default AI, and Test provider, which asks one tiny question with no email or file.

The built-in AI: local document extraction

The built-in model runs on this computer, with limited rights. Nothing leaves the computer, and it costs nothing. Get it once in the AI Assistant (beta) tab with Download (about 2.2 GB). It is slower than the cloud services and reads text only: the program takes the text out of PDF, Word and Excel attachments for it, but it can’t look at pictures.

Local AI for document extraction: the AI provider window for the Built-in AI model (on this computer), Make this the default AI ticked, nothing leaves this computer and it costs nothing, Test provider
The built-in AI: nothing leaves this computer.

Your own AI server

Ollama, LM Studio, or any server that speaks the OpenAI-style chat API, such as OpenRouter, Mistral or Groq. Enter its address, such as http://localhost:11434, and the model’s name, such as qwen3:8b. A server on this computer keeps everything here.

OpenAI (ChatGPT), Anthropic Claude, Google Gemini, Azure OpenAI

Use your own account and API key. For OpenAI that is a key from the OpenAI platform, not a ChatGPT subscription. The key is kept encrypted on this computer and sent only to that provider. Azure OpenAI uses your own Azure resource and its deployment.

ChatGPT email parser setup: the AI provider window for OpenAI with the Key box, an API key from the OpenAI platform not a ChatGPT subscription, Default model, Refresh list, Make this the default AI and Test provider
A cloud AI uses your own key, kept encrypted on this computer.

Step by step: describe the fields in the Parser

  1. On the Parser tab, click New parser and add a few sample emails, such as three invoices from Acme, Northwind and Fabrikam.
  2. In the Fields step, add a field Using AI. Under Look for, write what it is in your own words, pick its Type (text, number or date), and choose what happens If not found or wrong.
  3. Under What the AI reads, tick the parts: Subject, Sender and date, Body, Attachments’ text and, for scanned invoices, Scans (OCR).
  4. In Notes for the AI, add what helps, such as “Dates are day/month/year. Amounts are in EUR.”
  5. Pick the AI and click Run on all (here, all 3 samples).

On the right, each sample shows its values, how Sure the AI is, and whether the value is in the text. Answers are kept, so changing one field does not ask the AI again. Not sure what to ask for? Suggest fields lets the AI propose the values your samples have.

Extract data from email with AI in the Parser of Mail Attachment Downloader: four plain-words fields, the invoice number, the supplier's name, the date payment is due and the total to pay, read by the built-in model at 98% sure and found in the text, with What the AI reads, Notes for the AI, Hybrid mode and Compare models
Fields in plain words: the built-in model read three invoices on this computer.

Hybrid mode: patterns first, the AI only for the gaps

Tick Hybrid mode to Use patterns first, ask the AI only for fields they leave empty. A field found by a highlight or a pattern can also have If the pattern finds nothing, ask the AI. Most emails are then read by the pattern, which is instant and free, and the AI is asked only where the pattern finds nothing, such as a new supplier’s layout.

Compare models: which AI reads your emails best?

Click Compare models… and add the models to try. Run on the samples asks each one, and marks it against the values you ticked as right:

  • how many of each field it got right, such as 3 / 3 for the invoice number,
  • Time per email, and
  • Cost per 1,000 emails, an estimate from the size of your samples and the prices you type in. The real bill comes from the provider.

A setup to try proposes a mix, such as the built-in model first and OpenAI only for the emails where a field is empty or less than 80% sure. Use this setup keeps it: the cloud sees only the gaps.

Compare models in the Parser: the built-in model on this computer and OpenAI gpt-4o-mini marked against checked values for invoice number, supplier, due date and total, with time per email, cost per 1,000 emails and A setup to try with Use this setup
Compare models: the built-in model and a cloud model on the same three samples.

Confidence and review: doubtful values wait for you

In the Checks step, tick The AI is less sure than under Send an email to the review queue when, and set a percentage, such as 70. You can also review when a required field is blank or a check fails, such as a total outside the range you set.

A held email waits in Needs you. Nothing the parser writes, sends or moves is done for it until you approve. Open it to see the email beside its values, each with the AI’s percentage, correct a value and click Approve and run the actions (Alt+A), Skip for now (Alt+S), or Reject: do not process (Alt+R).

AI confidence review in Needs you: an invoice from Litware whose supplier was read with 58% confidence, the email's text beside the values for invoice number, supplier, due date and total, and Approve and run the actions, Skip for now and Reject
Needs you: the supplier was read with 58% confidence, so the email waits for a person.

AI in a PRO Rule: Find fields with AI and Run an AI prompt

For a quick field inside a rule, add a step with Add a step… › Data and fields:

  • Find fields with AI (PRO Rules Client and up): the same plain words, in the Fields found with AI window, with What the AI reads and Which AI reads it. The fields name files and folders, and feed the steps after it.
  • Run an AI prompt (PRO Rules Server): your own prompt about the email or its files, such as “Summarize this contract in three lines” or “Is this an invoice, a reminder or a credit note?”. The answer is kept as a field. Test the prompt tries it on a sample email.

The built-in model reads text files only in Run an AI prompt (TXT, CSV, JSON, HTML), not pictures or PDFs. The cloud services read pictures and PDFs too.

Find fields with AI step: the Fields found with AI window with the fields Invoice number, Due date and Total including tax described in plain words, What the AI reads ticked for subject, sender, body and attachments' text, and Notes for the AI
Find fields with AI: plain-words fields inside a PRO rule.
The Run an AI prompt step in the Rule Editor: AI model Use the default (Built-in model), nothing leaves this computer, the built-in model reads text files only, a Prompt box with Ideas and Fields, Send files, Save the answer in and Test the prompt
Run an AI prompt: the answer becomes a field for the next steps.

What leaves your computer?

  • Built-in model, or your own server on this computer: nothing.
  • A cloud AI: the parts you ticked under What the AI reads, or the prompt and the files you chose, sent to that provider only. Its terms for your account apply.
  • Never without asking: before a cloud AI is used, the program names the provider and what would be sent, and asks. It asks again when you change the service. You can go back to the built-in model at any time.

Questions people ask

Can I use ChatGPT as an email parser?

Yes, with an API key from the OpenAI platform. A ChatGPT subscription doesn’t include one. Pick OpenAI in AI Providers, then in the parser.

Does the local AI need the internet?

Only for the one-time download. After that the built-in model reads your emails on this computer.

Can it read scanned invoices?

In the Parser, tick Scans (OCR) so scans are read before the AI is asked. Find fields with AI reads the text of PDF, Word, Excel and text files, not images or scans.

How do I know the AI got it right?

Every value shows its percentage and whether it is in the text. Compare models tells you which AI is right most often on your own emails, and review holds the doubtful ones. See Extract data from emails and attachments for highlights, patterns and tables.

Try it: download Mail Attachment Downloader and start with the free edition, or compare the PRO editions, each with a 30-day money-back guarantee.

Related

Questions about this post? Contact us.

Process e-invoices from email: ZUGFeRD, Factur-X, XRechnung and Peppol UBL

Turn ZUGFeRD, Factur-X, XRechnung and Peppol UBL invoices from email into CSV, Excel or SQL rows, with sum and duplicate checks. No AI needed.

More and more invoices arrive as e-invoices: a PDF with the invoice’s data inside it, or the data alone as an XML file. That data already holds the invoice number, the dates, the supplier, the totals and every line. You shouldn’t have to type it in again, or ask an AI to guess it from the picture.

This post shows how Mail Attachment Downloader’s PRO Parser picks e-invoices out of a mailbox, reads their own data, checks it, and writes it to CSV, Excel or a database, with each invoice file saved under a name that means something.

Why e-invoices are arriving now

Several European countries are making structured e-invoices the norm between businesses. In Germany, businesses have had to be able to receive e-invoices since January 2025, and the duty to send them phases in through 2028. France’s reform began in September 2026, also in phases, and many other countries exchange e-invoices over the Peppol network.

Dates and details change, and they depend on your country and your business. Check the rules that apply to you; this post is not legal or tax advice.

What the Parser reads

The Parser reads the invoice’s own data. It finds it in two places:

  • A PDF with the XML inside it. Factur-X and ZUGFeRD invoices are PDF/A-3 files that carry the XML as an embedded file. You see a normal invoice; the Parser reads the data.
  • The XML alone. An XRechnung or a Peppol invoice is often just an XML file attached to the email. The Parser knows it by what it holds, not by its name.

It reads the two forms that EN 16931, the European e-invoice standard, allows:

  • CII: the UN/CEFACT Cross Industry Invoice, used by Factur-X, ZUGFeRD 2 and XRechnung in its CII form.
  • UBL 2.1: used by XRechnung in its UBL form and by Peppol BIS Billing 3.

Credit notes are read too. The older ZUGFeRD 1.0 is not.

The example

Contoso’s accounts payable team gets invoices at finance@contoso.com. Acme sends Factur-X PDFs, Fabrikam sends XRechnung XML files, and Northwind’s invoices come in as Peppol UBL. We want each one in a spreadsheet, and each invoice file saved in \\fileserver\Finance under its supplier and invoice number.

Step 1: Show the Parser an e-invoice

Open the Parser tab and click “New parser”. In “Source”, choose “Emails from a mailbox” and search for an email with an e-invoice, such as “INV-2026-0423”. Or choose “A file”, or drop the PDF or XML on “Drop files or emails here”.

The Parser's Source step: emails found by searching INV-2026-0423, the email from Acme Beispiel GmbH ticked as a sample and 1 email pinned
Pick an e-invoice email from Acme as the sample.

The step suggests 3 to 25 samples of the same kind. For e-invoices one already gives every field, because the values come from the invoice’s own data, not from learning; a few more let you check the results on several suppliers.

Step 2: Use the invoice’s own data

In “Fields”, when the sample carries e-invoice data, a green banner says so: “This invoice carries its own data. 22 fields and 2 lines found, exact, no AI needed.”

The Fields step of a new parser showing a Factur-X XML invoice, with a green banner: This invoice carries its own data, 22 fields and 2 lines found, exact, no AI needed, and the buttons Use the invoice's data and Choose which
The Parser sees that the sample carries its own invoice data and offers to use it.

Click “Use the invoice’s data”. Each value becomes a field, and the lines become a table. Or click “Choose which…” to tick only the values you want, then “Use the chosen”.

The fields you can get are: invoice number, invoice date, due date, currency; seller and buyer name, VAT id, country and email; buyer reference, order number, payment means, IBAN; subtotal, tax total, total, amount due; the document type (invoice or credit note) and the sum of the lines. An invoice only gives the values it holds.

The lines table has a row for each line of the invoice: line number, description, quantity, unit, unit price, tax rate and amount. Simpler e-invoices may carry no lines; then you get the fields alone.

The Fields step after Use the invoice's data: 22 fields such as invoice_number, issue_date, due_date, currency, seller_name and seller_vat_id, each tagged From invoice data and found in 1 of 1 samples, a lines table, and the values highlighted in the XML
22 fields and the lines, made from the invoice’s own data. Each field is tagged “From invoice data”, and its value is highlighted in the XML.

These fields are tagged “From invoice data”. No pattern to keep up, no AI to pay for, and the values are exact: dates as yyyy-MM-dd, amounts with a dot. Nothing leaves your system. Tick “Show fields” to see where each value sits in the XML.

Step 3: Check what came in

Exact values can still be wrong for you: a total far bigger than usual, lines that don’t add up, or the same invoice sent twice. In “Checks”:

  • Per field. Under “Check each field”, give the total a range with “Between”, or mark a field “Not blank”. Under “If it fails”, choose “Send to review”.
  • Sums. Under “Check fields together”, tick “The amounts of the lines add up to the subtotal (within 0.01)”. For an e-invoice, the lines are checked against the sum the invoice itself states.
  • Duplicates. Tick “The same”, pick the invoice number and the supplier (for e-invoices, invoice_number + seller_name, or the seller’s VAT id), and choose what happens when it “was parsed before:” “Skip it and note it”, or send it to review. A supplier who sends the same invoice twice isn’t paid twice.
The Checks step: a Between 0.01 and 100000 check on the total that sends it to review, the lines add up and subtotal plus tax checks, a duplicate check on invoice_number + supplier set to Skip it and note it, and the review queue settings, with 3 samples passing
Checks on a supplier-invoice parser: a range for the total, sum checks, and the duplicate-invoice check, tried on the samples first.

Under “Send an email to the review queue when”, leave “Any check above fails” and “A required field is blank” ticked.

Step 4: Review what was held back

An invoice that fails a check waits in Parser › “Needs you”. Nothing is written, sent or moved for it until someone looks. You see the email beside its values; fix one if needed and click “Approve and run the actions (Alt+A)”, or “Skip for now (Alt+S)”, or “Reject: do not process (Alt+R)”.

The Needs you queue of a parser called Supplier invoices: one invoice waiting, shown beside its values, with the buttons Approve and run the actions, Skip for now and Reject
The review queue. This one is a plain text invoice held for a low-confidence read; an e-invoice is held when a check fails or it is a duplicate.

Step 5: Send the data where you need it

In “Output”, choose where the values go. With PRO Parser:

  • “CSV file”, “Excel workbook” or “Google Sheets”: one row per email, with the columns you pick, such as {INVOICE_NUMBER}, {SELLER_NAME}, {ISSUE_DATE} and {TOTAL}. The invoice lines can go to their own sheet, one row per line.

With PRO Rules Server:

  • “SQL database”: a row per invoice in SQL Server, MySQL, PostgreSQL or any ODBC database.
  • “Webhook”: the fields as JSON to your accounting or ERP system.
  • “Tell me”: a message to Slack, Teams and other channels.

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

Step 6: Save and name the invoice file

Under “Save files”, choose “The attachments” for the PDF or XML, or “The email and its attachments” to keep the email as an .eml file as well. Then build the folder and name from the fields with “Fields…”:

Folder: \\fileserver\Finance\E-invoices\{SELLER_NAME}
File name: {ISSUE_DATE}_{INVOICE_NUMBER}_{FILENAME}{EXT}

Acme’s invoice then lands as \\fileserver\Finance\E-invoices\Acme Beispiel GmbH\2026-10-22_INV-2026-0423_INV-2026-0423.pdf. The PDF is saved as it arrived, with its embedded XML.

The Output step: Save files set to The attachments, with folder and file name boxes and Fields buttons, and a CSV file with columns for invoice number, invoice date, PO number, due date, total and supplier, with a CSV preview
Save files and a CSV file on the Output step. The folder and name take any field the parser reads.
The Parser's Output step for the E-invoices parser: The attachments saved to \\fileserver\Finance\E-invoices\{SELLER_NAME} as {ISSUE_DATE}_{INVOICE_NUMBER}_{FILENAME}{EXT}, the For example path, and a CSV preview of the 22 values
Save each e-invoice in a folder per supplier, named by date and invoice number.

Step 7: Turn it on

In “Run on”, choose the accounts. Tick “Process the emails in the backup now” to handle the e-invoices of the last 30 days straight away, without downloading them again. Leave “Turn on after saving” ticked and save. From then on, the parser runs with each download.

Suppliers who send plain PDFs need a second parser, built with “Highlight” or “Using AI”; see invoice emails to your invoice processing software.

What it doesn’t do

  • It reads e-invoices; it doesn’t create or send them.
  • It doesn’t validate an invoice against the official XRechnung or Peppol rules. It takes the totals as the invoice states them and checks only what you set up in “Checks”.
  • It reads e-invoices that arrive by email (or as files). It isn’t a Peppol access point. If your Peppol provider can pass invoices on by email, the Parser reads them like any other.

Which edition do you need?

  • PRO Parser: everything above with CSV, Excel and Google Sheets output, up to 5 accounts per run. Includes PRO Backup.
  • PRO Rules Server: adds the SQL database, webhook and “Tell me” outputs, and runs as a Windows service with no one signed in.

The Free edition can save e-invoice files but doesn’t read their data. See PRO Parser: e-invoices and pricing.

Try it: download Mail Attachment Downloader and start with the free edition, or compare the PRO editions, each with a 30-day money-back guarantee.

Related

Contact us with any questions about this post.

Extract data from emails and integrate your business systems

Pick emails and files, read the values in them and pass them to your other systems, on a schedule or 24×7 as a Windows service.

This post shows how to extract data from emails, automate the work that follows and cut out repetitive tasks. It also gives an overview of how to connect your line-of-business systems with Mail Attachment Downloader 4.0.

Note: this is a high-level overview. For a step-by-step look at rules, see PRO Rules and moving from account settings to PRO Rules.

Automate email with attachments

What options do you have?

Mail Attachment Downloader PRO is a cost-effective way to automate email in your business. It runs on your own system, on a PC, a server or a cloud VM, and reads your mail server directly, with no cloud service in between.

The work is done by rules. Set up as many as you need, for one account or for all of them at once. In 4.0, rules live in the PRO Rules tab, the new name of 3.x’s Global filters. Each edition adds to the one before: PRO Backup, PRO Parser, PRO Rules Client and PRO Rules Server. See which edition fits.

The PRO Rules tab with a shared filter for supplier invoices, rules under it, and rules that convert, OCR and send orders on
The PRO Rules tab: each rule has its own conditions, save folder and steps.

Scheduled processing

Every PRO edition can download on a schedule from Schedule › App schedule, and pick up new mail as it arrives.

With PRO Rules Server, the same work runs 24×7 as a Windows service, installed from Schedule › Service schedule. It keeps running when nobody is signed in, and starts again by itself after a restart (Auto start on bootup). It runs on Windows Server or Windows 10 and later, so on a PC, a server or a cloud VM in Azure, AWS and others. See the PRO Rules Server how-to.

Schedule › Service schedule before the service is installed, with Install the service for, Check every and Auto start on bootup
Schedule › Service schedule: pick the account, how often to check, and click Install service.

Order of rules

Rules run from the top of the list down. Each email or file goes to the first rule that takes it. Rule settings › Check rule order… finds rules that can never save anything because a rule above takes their files. Test all rules… tries your rules on real emails without moving, deleting or sending anything.

The parts of a rule

A 3.x rule had four phases: search, extract, save and process. In 4.0 you build a rule in the Rule Editor, and the same ideas are its sections:

  • Which emails: the conditions, such as sender, subject, dates, attachment name, account or folder, with AND / OR groups.
  • Fields to find: values read from the email, such as an order number, for file names and steps.
  • Save: the attachments, the email or both, where, and how files are named. A network share works too (use a UNC path such as \\server\share).
  • Then: the steps that run after saving, in order. Steps can hold other steps: unzip a file, convert what is inside to PDF, then save its details to a database.
  • If something fails: what runs when a step fails, such as alerting your team.
The Rule Editor with Which emails, Fields to find, Save, Then and If something fails, and steps nested under Find fields with AI
The Rule Editor: steps under Then run in order, and nested steps work on the result of the step above them.

Prefer to describe it? On the AI Assistant tab, say in plain words which emails to take and what to do, and the AI builds the rule. The built-in AI runs on your own system; a cloud AI is used only once you choose it.

Multiple accounts and other sources

To limit a rule to one account, add an Account condition under Which emails. Rules also run on watches (PRO Rules Client and up): new files in folders, network shares, SharePoint, OneDrive or S3, and completed DocuSign envelopes. PRO Rules Server adds database tables, Slack and Teams. See Watches.

Integrate with your other systems

Steps under Then hand files and values to the systems you already use: Upload to cloud and Send to document management (Laserfiche, M-Files, DocuWare) from PRO Rules Client, and Save to a database, Web hook, Send to Zapier and Run a script in PRO Rules Server. For processing in your own code, a plugin API takes your own C# step. Contact us for more.

Common uses

Conclusion

Mail Attachment Downloader 4.0 PRO automates the data in your email on your own system: a PC, a server or a cloud VM. Rules pick the emails and files, read the values, save them your way and hand them on, and PRO Rules Server keeps it running 24×7.

Have a use case that isn’t covered, or need help connecting your back-end systems? Let us know.

Try it: download Mail Attachment Downloader and start with the free edition, or compare the PRO editions, each with a 30-day money-back guarantee.

Related

Using version 3.x? See the 3.x version of this guide.