How to test message size and attachment limits?

Still have a question, spotted an error, or have a better explanation or a source we should cite?

You've crafted the perfect email, attached that important PDF, and hit send. Then a bounce comes back: 552 Message size exceeded. Frustrating, right? Knowing how to test for size limits before it happens to a real message is a skill worth having.

Here's how to test message size and attachment limits properly.

Check the EHLO SIZE parameter first

When your sending server connects to a receiving server, it says hello with an EHLO command. The receiving server often responds with a SIZE extension that tells you its maximum message size. If you see SIZE=26214400 in that response, that's a 25MB limit (26,214,400 bytes divided by 1,048,576 bytes per megabyte). Not every server advertises this, but when they do, it's the most reliable signal you'll get. You can learn how to read a full SMTP exchange in the guide on reading SMTP transcripts.

Test progressively with real messages

If the server doesn't advertise a SIZE parameter, you can find the limit by sending test messages of increasing size to a test account at that provider. Start small, then work up in increments (5MB, 10MB, 15MB, 20MB, 25MB). Note exactly where the rejection happens. Do this with a few different attachment types too, since some servers scan attachments differently.

And one thing that trips people up: attachments get Base64-encoded when they travel over email, which adds roughly 33% to the raw file size. A 15MB PDF attachment actually becomes around 20MB in transit. So if a server has a 25MB message limit, your practical attachment ceiling is closer to 18MB before you add in the email body and headers.

Know the common limits going in

Read the error codes when a rejection happens

Size-related rejections come with predictable error codes. 552 means the message exceeded the server's size limit. 5.3.4 is the enhanced status code for a message that's too big. You'll often see plain text like "message size exceeds limit" in the bounce body too. These are hard bounces, so don't retry them with the same oversized message.

The practical rule

Keep messages under 10MB if you need wide compatibility across corporate mail servers. If you're sharing large files, put them in Google Drive or Dropbox and link to them. Don't embed download URLs directly in the message body either. Security gateways flag those and they'll hurt your deliverability. A clean link to a cloud folder is the better move every time.

If you're doing deeper SMTP diagnostics and want to test message delivery end to end, Mailtrap gives you a safe sandbox to inspect everything without hitting real inboxes.

Stuck on a specific bounce or delivery failure? Our SOS hotline is free and we actually pick up.

Contributors

Who worked on this answer

Every name links to their profile. Every company links to their site. Real people, real accountability.

Ask an AI · tailored to your setup

Get a step-by-step size limit testing plan

I want to test whether my emails are hitting size limits with a specific mail provider. Based on my setup below, walk me through how to check the EHLO SIZE parameter, design a progressive test, and interpret bounce error codes like 552 and 5.3.4. - Provider or domain I'm testing against: e.g. Gmail, corporate mail server at company.com - How I'm sending (ESP, SMTP relay, or raw connection): e.g. Postmark, custom SMTP - Typical message size I'm sending: e.g. 8MB with a PDF attachment - Any error codes I've already seen: e.g. 552, 5.3.4, none yet Please give me: 1. Steps to check if the server advertises a SIZE limit via EHLO 2. A progressive testing plan with recommended size increments 3. How Base64 encoding affects my attachment sizes 4. What the error codes mean and how to handle them

Edit the yellow boxes, then send to the AI of your choice.