How to Send Email With Attachments: PDFs and Invoices

How to send email with attachments from a project built in Claude Code: when to attach or link, size limits, what to tell Claude Code, and PDF invoices.

Quick answer

To send an email with an attachment from a project you build in Claude Code, connect an email service, then tell Claude Code which file to attach and when. Attach small files people need to keep, like PDF invoices or tickets. For anything over about 15 MB, or files that change, send a link instead.

Last checked: October 2026

On this page
  1. When should you attach a file, and when should you send a link?
  2. How big can an email attachment be?
  3. What to tell Claude Code to send email with attachments
  4. How do PDFs and invoices work?
  5. How do you check the attachment arrives?

Some emails are only useful with a file attached: an invoice for someone's accounts, a ticket for an event, a report they asked for. This guide is for people building a SaaS, site or tool with Claude Code who want to send email with attachments without writing the code themselves.

You'll learn when to attach a file and when a link works better, how big attachments can be, the exact message to send Claude Code, and how PDFs and invoices fit in.

Attach a file when it's small, final and something the person will want to keep. Send a link when the file is large, will change, or is private.

An attachment is a copy that lives in the person's inbox for good. That's ideal for an invoice or a ticket. It's less ideal for a document you might update next week, because the old copy stays in their inbox.

SituationAttach or link?Why
PDF invoice or receiptAttachSmall, final, and people file them for their records
Event or booking ticketAttachPeople want it on hand, even offline
Calendar invite (an .ics file)AttachMost inboxes offer an "add to calendar" button for it
Monthly report or data exportEitherAttach if it's small; link if it's large or updated often
Video, large design file or big archiveLinkToo large for most inboxes
Contract, ID document or anything sensitiveLinkA sign-in page keeps it safe if the email is forwarded

How big can an email attachment be?

Gmail and Outlook.com both accept up to 25 MB per email for personal accounts. Work and school accounts can have lower limits, set by their administrators. The limit covers every attachment in the email added together.

There's a catch. When a file is attached, it gets converted into text so it can travel by email, and that makes it about a third larger. So a 20 MB PDF arrives as roughly 27 MB, which is over the limit.

That's why we suggest a simple rule: if a file is over about 15 MB, send a link instead. Most invoices, receipts and tickets are well under 1 MB, so this rarely comes up for everyday transactional email (the automatic emails your project sends when something happens, like a purchase).

Your email service has its own limit too. SimpleSends allows up to 25 MB per email, the same as Gmail and Outlook.com, so the 15 MB rule keeps you safely under every limit here.

Where the limit appliesLimit per email
Gmail (personal accounts)25 MB
Outlook.com25 MB
Work and school accountsSet by their administrator, often lower
SimpleSends25 MB

What to tell Claude Code to send email with attachments

Describe the email the way you'd brief a person: when it goes out, who gets it, what's attached, and what the email says. Claude Code then builds it into your project so it sends automatically.

Tell Claude Code

When a customer's order is paid, send them a confirmation email with their invoice attached as a PDF. Name the file with the invoice number, like Invoice-1042.pdf. Keep the email short and friendly, and show me a preview before you add it.

You should get back a preview of the email and a sample PDF to check. Once you're happy, Claude Code adds it to your project. For files that might be large, ask for a link instead:

Tell Claude Code

Our monthly export emails can get big. If the file is over 15 MB, send a download link that works for 7 days instead of attaching it, and say that clearly in the email.

Here's what the invoice email might look like:

Sample email

Attachments show up in plenty of other emails too. For calendar files, see our guide to booking confirmation and reminder emails. For receipts, see order confirmation emails. The full list of emails a SaaS usually sends is in 12 transactional emails every SaaS needs.

How do PDFs and invoices work?

Your project creates the PDF first, then attaches it to the email. Claude Code can set up both steps: it builds the PDF from your order or account details, using your logo and colors, and then sends it with the email.

If you take payments through Stripe, check what Stripe already sends before building your own. When Stripe emails an invoice, it attaches a PDF copy automatically. You can turn Stripe's emails off and send your own branded version instead. Stripe tells your project about each payment with a webhook (an automatic message from one service to another when something happens), and your project sends the email from there.

Tell Claude Code

I want to send my own invoice emails instead of Stripe's. Check which Stripe emails are switched on, tell me which ones to turn off, then set up our own email with the PDF invoice attached.

For the full walkthrough, see how to email invoices automatically and how to send your own emails after a Stripe payment.

How do you check the attachment arrives?

Send a test to yourself before real customers see it. Open the email in the inbox you use most, then on your phone, and open the attachment in both places.

Tell Claude Code

Send a test of the invoice email to me with a sample order. I'll check the PDF opens and the details match.

Check the file name, that the PDF opens, and that every number in the PDF matches the email. Our guide to testing your emails before your users see them has a full checklist.

Frequently asked questions

Can one email have more than one attachment?

Yes. An email can carry several files, such as an invoice and a receipt together. The size limit applies to the full email, though, not to each file, so add up every file before you decide. If the total gets close to the limit, attach the most important file and link to the rest.

Which file types get blocked as attachments?

Inboxes block files that can run programs. Gmail, for example, refuses attachments such as .exe, .bat and .js files, the same files inside .zip archives, and password-protected archives. PDFs, images, spreadsheets, CSV files and calendar files go through fine, which covers almost everything a SaaS needs to send.

Should I password-protect a PDF before attaching it?

For most invoices and receipts, no: it adds a step for your customer and little extra safety, because the password usually travels by email too. For truly sensitive files, such as contracts or ID documents, send a link to a page that asks the person to sign in instead of attaching the file.

Can I put images inside the email instead of attaching them?

Yes. Logos, product photos and charts usually look better shown in the body of the email than added as attachments. Ask Claude Code to place the image in the email design. Keep attachments for files the person needs to save, print or forward, like a PDF invoice or a ticket.

Sources (5)