← All articles
Email ParserAI Document ParserPDF Attachments

How to Parse Emails and PDF Attachments with AI

Learn how to parse email bodies and PDF attachments with AI, choose useful fields, check tables and totals, and keep each value connected to its source.

By Dylan Dan
How to Parse Emails and PDF Attachments with AI — illustrated cover showing separate email and PDF sources processed into reviewed structured fields.

Quick Answer: Decide whether the information you need is in the email body, an attachment, or both. Upload a saved EML or TXT message for body content, or upload the PDF for document content. Confirm the suggested fields, run extraction, and compare the result with the right source before exporting.

An email can say “Please find the invoice attached” while the PDF contains every amount you need. Another message can list an order directly in the body. An AI document parser needs the right source for the task.

This guide helps you choose that source and keep the results clear. It uses fictional examples, including an order confirmation shown in UpParser's public demonstration. The public demonstration isn't a new extraction test performed for this article.

Start by finding the information

Open one message and ask a simple question: where are the values I want? You might find a customer name in the body and invoice line items in a PDF. Those are related pieces of information, but they aren't the same document.

Make a short list of the fields you need. For an order email, that might be order number, customer, date and delivery address. For an invoice attachment, you may need supplier, invoice number, tax and total.

Don't begin by asking for every possible field. A small set is easier to check. You can add columns when you know why you need them.

What can you pull out of an email?

Orders and invoices are only two examples. Here are common email types and the fields people usually want from them:

Email typeFields people often want
Order confirmationOrder number, customer, date, products, quantities, prices, total, delivery address
InvoiceSupplier, invoice number, dates, tax, total, purchase order reference
Contact details in a signatureName, job title, company, phone, website
Quote or enquirySender, company, request, product, quantity, deadline
Shipping noticeOrder number, carrier, tracking number, expected date
Booking confirmationName, dates, location, reference number, price
Job applicationName, contact details, role, attached resume
Support requestSender, topic, product, order number, urgency

Pick one type to start. Each type needs its own fields and its own checks.

Rules or AI? A Simple Guide

There is more than one way to read an email automatically. Knowing the difference helps you choose.

MethodHow it worksGood forWatch out for
Rules or templatesYou tell the tool exactly where to look, such as "the text after Order number:"Emails that always look the same, such as system notificationsCan miss or misidentify fields when the sender changes the layout
Position-based reading (zonal OCR)You mark an area on a page, and the tool reads that areaDocuments with a fixed layoutA shifted layout can give wrong or empty values
AIYou list the fields you want, and the AI looks for themMessages and documents that vary in layoutCan misread. Needs checking

Use rules when the relevant labels and layout are stable. Use AI when senders write in different ways. In both cases, check the results.

If an attachment is already an Excel or CSV file, you may not need extraction at all. You can open it directly. Use a parser when the layout is irregular or the data is inside a PDF or image.

Choose the right starting file

Where the information appearsStarting fileFirst check
Message body and headersSaved EML, or TXT with the needed header labelsThe current message and required headers are included
PDF invoice attachmentThe PDFAll invoice pages are present
Image invoice attachmentA supported imageSmall print is readable
Body and attachmentsSeparate test files firstEach field has a clear source

If you save a message as plain text, keep the useful labels. A line such as “Order number: ORD-2026-7821” is easier to check than an unlabeled number copied out of context.

For Gmail, Google's message download instructions explain how to save a message as an EML file. Saving a message doesn't mean every embedded attachment will automatically become a separately parsed document in every upload route.

If you use another email program, look for a Save As option and check which formats the parser accepts. If you can't save the message in a supported format, printing it to PDF can preserve the visible message. It may omit headers or attachments, so process those separately when needed and check the result with a document tool.

Before you upload an email

  • Save only the message you need, not your whole mailbox.
  • Check what is inside. Emails can hold signatures, phone numbers, addresses, and old messages further down the thread.
  • Leave out sensitive emails, such as ones with passwords, ID numbers or private conversations.
  • Check where the data goes. Ask who can see it, where it is stored and how to delete it.
  • Know your rules. If the email has personal data about customers or staff, check your company's policy.

Step 1: Open the Email Parser

Open UpParser Email Parser. The page shows Choose a file and identifies EML or text as its starting formats.

UpParser Email Parser public page with EML or text file upload

Select a saved message or text file. Sign in if the application asks you to. Use one clear example before trying a message with a long conversation below it.

Don't upload a PDF to the email-specific route just because it arrived by email. For the invoice itself, use the Invoice Parser or an appropriate document workflow.

Step 2: Review the suggested fields

After uploading, check the fields the tool suggests. These fields become the information you see in the result. They should match your task, rather than every piece of text in the message.

For the order example, keep order number, customer name, date, subtotal, tax, delivery charge, total and currency. Add delivery address if someone will use it to arrange shipping.

If you need products too, define a product table with description, quantity, unit price and line total. Keep that table separate from the order's overall total.

You can add a plain instruction: “Use the latest order confirmation. Ignore quoted replies and the email signature. Leave missing values blank.” Check that the source really contains the information you're requesting.

Step 3: Compare each field with the message

Run extraction, then compare values with the current message. Don't stop after seeing a tidy table. Check that the order number belongs to this order, rather than an older order mentioned in the thread.

UpParser's public order demonstration shows ORD-2026-7821 for Jordan Miles. Its subtotal is 202.00, tax is 16.16, delivery is 8.00 and total is 226.16, in USD. These are fictional demonstration values.

Public UpParser order email demonstration showing the message beside selected fields

In the public example, the source message and the selected fields sit side by side. The useful habit is to compare meaning as well as text. A date can be copied correctly while still being the wrong date for your task.

Step 4: Check tables and totals

Look at product rows separately from the summary fields. The public example contains two oak task lamps at 65.00 each and four notebook sets at 18.00 each. Their line totals are 130.00 and 72.00.

Those lines add to subtotal 202.00. Adding tax 16.16 and delivery 8.00 gives total 226.16. A delivery charge shouldn't quietly become a product, and the overall total shouldn't be added once for every line.

Public UpParser demonstration showing order charges and product rows

These are public teaching figures. Use the figures printed on your own message when checking your result. Different orders may use discounts, different tax treatment or different rounding.

Checks to write down

Before you trust any result, decide what "correct" means. A short list is enough:

  • Are the required fields filled in (order number, customer, total)?
  • Do the lines add up to the subtotal?
  • Do the printed subtotal, tax, delivery and any discounts agree with the total, allowing for rounding?
  • Is the currency right?
  • Is the date in the format you expect?
  • Has the same order already been recorded?
  • Is anything blank that should not be?

Mark any result that fails a check, and look at the source message.

Step 5: Process the PDF attachment separately

If the email includes an invoice PDF, save that attachment and open the invoice tool. Upload the document, then confirm invoice-specific fields. Use supplier and invoice number rather than customer and order number when those are the values you need.

Check every page. A first page may show summary amounts while the final page holds more products or payment terms. Missing pages can make a result look complete when it isn't.

Keep the attachment filename or another source reference alongside your working records. This helps you return to the correct document if the email mentions several invoices.

Our invoice attachment guide covers that file-based process in more detail. Start there if the email body contains no useful business information.

Step 6: Keep body and attachment values distinct

Suppose the body says “Please arrange payment by Friday” but the invoice prints a different due date. Don't silently put Friday in a field called “invoice due date.” Keep a separate requested-payment note if your team needs it.

The same applies to names. An email sender may be a bookkeeper while the invoice supplier is a company. Both can be correct, and neither should automatically replace the other.

If your process needs one combined record, define how the pieces are matched. Use a clear invoice or order reference and review disagreements. Don't assume that processing both sources automatically creates a joined record with the right business meaning.

A Simple Way to Combine the Two

Keep the body result and the attachment result separately, then match them using a shared reference. The following manually prepared table illustrates the source labels; it is not a built-in automatic merge or a tested output:

Email dateSenderReferenceSourceFieldValue
2026-11-10[email protected]INV-2026-2089BodyPayment requested byFriday
2026-11-10[email protected]INV-2026-2089PDF attachmentDue date2026-12-03

A Source column shows where each value came from, and a Reference column lets you match rows later. These rows are fictional examples. When two sources disagree, ask a person which to use.

Step 7: Download the reviewed result

Choose Excel, CSV or JSON according to the next task. Excel is useful for a human review. CSV is useful for a plain table. JSON can be useful when software needs fields and nested product rows.

Open the downloaded file. Check a record with several product rows and make sure invoice or order numbers haven't been changed by your spreadsheet application.

For invoice attachments, read the invoice CSV export guide when preparing a particular column order. For email-body results, check the destination's own column requirements. Getting the values right and arranging the columns correctly are separate checks.

Step 8: Reuse the setup carefully

Save the confirmed fields as a workflow after a good test. Then try a message with a different layout. Include a forwarded thread so you can check whether earlier quoted content causes confusion.

UpParser documents workflow email intake for forwarded messages, with body and attachment processing options. Use those controls deliberately. Enabling both doesn't remove the need to check what records each message produces.

Automatic processing here doesn't mean direct inbox monitoring or automatic replies. Keep the first test small and visible before asking a team to depend on it.

Forwarded emails

When someone forwards an email, the original message sits inside the body, below the forwarder's own words. The tool may read both. In your instruction, say which one you want, for example: "Use the original order confirmation below the forwarded line, not the note from the person who forwarded it."

Test with 10 Emails Before You Rely on It

Start with a small pilot, such as ten representative messages. This can reveal obvious problems, but it does not prove reliability across every sender, layout or rare exception. Expand the test before relying on the setup for regular work.

  1. Pick 10 emails of the same type, including one or two messy ones. Remove anything private.
  2. Write down the correct values for each, or keep the source open.
  3. Run them through your setup.
  4. Mark each field as correct, wrong or missing.
  5. Look for patterns. Are the mistakes in one field, one sender or one layout?
  6. Change the instructions or fields, and test again.
  7. Keep these ten as your test set, and run them again whenever you change the setup.
FieldCorrectWrongMissing
Order number
Customer
Date
Total

Fill in the table yourself. A tool can look fine on three clean emails and fail on the tenth.

Common problems

An old number appears. Look for quoted replies or earlier messages. Clarify that you want the latest relevant document, then test again.

The sender becomes the customer. Check whether the message is forwarded by a colleague. Define customer separately from sender.

A PDF field is missing from the body result. Process the PDF itself or use a workflow configured for attachments. Don't assume an attachment is included merely because the saved message mentions it.

Several invoices become one record. Check attachment handling and define the expected number of invoice records before exporting.

Dates look wrong. An email from another country may write 03/04/2026 to mean 3 April or 4 March. Check the day and month, and ask for dates in an unmistakable format such as 2026-04-03.

Amounts look wrong. Some countries use a comma for decimals (1.234,56). Check that the tool and your spreadsheet read them the same way.

The message is mostly an image. If the text is inside a picture, the body may be empty. Use an image or document route, and check that small print is readable.

The email is in another language. Test a few examples. Check names, dates and amounts carefully.

FAQ

Do I need to write code?

You can start in the browser with saved messages and documents. Code is only needed when you choose a custom integration that requires it.

Can AI read any email layout?

Test your own layouts. Clear labels help, but threads, images, missing pages and unusual tables can still require review.

Should I use one workflow for everything?

Start with one clear task. Separate order emails from invoices when the fields and checking rules are different.

Should I use rules or AI to read emails?

Use rules when the format never changes, such as system notifications. Use AI when senders write differently each time. Check the results either way.

Do I need a parser if the attachment is already an Excel file?

Often not. You can open it directly. Use a parser when the layout is irregular, or the data is in a PDF or image.

How do I save an email so I can parse it?

In Gmail you can download the message as an EML file. In other programs, look for Save As and check which formats the tool accepts.

How many emails should I use to test?

Ten representative messages of the same type can be a useful first pilot. Include messy examples, then expand the test; this is a practical suggestion, not a validated sample size.

Is it safe to upload emails?

Emails can hold personal and business data. Upload only the messages you need, leave out sensitive ones, and check who can see the data, where it is stored and how to delete it.

How do I combine data from the body and the attachment?

Keep them in separate tables, add a Source column and a shared reference such as an invoice or order number, and match them. Ask a person to decide when they disagree.

About the Author

Dylan Dan is the founder of UpParser and the team behind it. He led the team in developing all of the website's data extraction workflows and is a data extraction and processing expert with years of experience. He writes UpParser guides on extracting, organizing, and checking data from invoices, bank statements, receipts, and other documents. His published guides cover invoice processing, spreadsheet preparation, and invoice OCR error checks.

✉ Contact our human support team via Gmail, 24/7. We’ll help with UpParser and data extraction questions as quickly as possible.

Related Articles

See current plans and credit pricing.