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
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.
When should you attach a file, and when should you send a link?
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.
| Situation | Attach or link? | Why |
|---|---|---|
| PDF invoice or receipt | Attach | Small, final, and people file them for their records |
| Event or booking ticket | Attach | People want it on hand, even offline |
| Calendar invite (an .ics file) | Attach | Most inboxes offer an "add to calendar" button for it |
| Monthly report or data export | Either | Attach if it's small; link if it's large or updated often |
| Video, large design file or big archive | Link | Too large for most inboxes |
| Contract, ID document or anything sensitive | Link | A 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 applies | Limit per email |
|---|---|
| Gmail (personal accounts) | 25 MB |
| Outlook.com | 25 MB |
| Work and school accounts | Set by their administrator, often lower |
| SimpleSends | 25 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.
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:
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:
SubjectYour invoice from YourCompany (#1042)
Hi Sam,
Thanks for your order. Your invoice is attached as a PDF for your records.
Amount paid: $49.00 Invoice number: 1042
If anything looks wrong, reply to this email and we'll sort it out.
The YourCompany team
Attachment: Invoice-1042.pdf
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.
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.
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)
- Send attachments with your Gmail message(checked October 5, 2026)
- File types blocked in Gmail(checked October 5, 2026)
- Sending limits in Outlook.com (Microsoft Support)(checked October 5, 2026)
- RFC 2045: MIME Part One, section 6.8 Base64 (IETF)(checked October 5, 2026)
- Send customer emails (Stripe Docs)(checked October 5, 2026)
Keep reading
More on Task guides →Waitlist Confirmation Email: How to Send One Automatically
How to send a waitlist confirmation email automatically: what to include, position and referral links, the launch email, and what to tell Claude Code.
5 min read
Send Invoice Email Automatically From Your SaaS
Send invoice email automatically from your SaaS: what the email needs, where the PDF comes from, Stripe’s emails vs your own, and what to tell Claude Code.
6 min read
Booking Confirmation Email and Reminder Setup Guide
Send a booking confirmation email the moment someone books, add a calendar file, and schedule reminders. Includes messages for Claude Code and sample emails.
6 min read