Recommended Maximum Email Size and Proven Ways to Optimize It
Tags: email
Published: 2022-10-19 10:31:38

Every email sending provider has its own maximum email size limit. However, there is no unique standard – limits are dictated mostly by performance and security reasons. There are many things you should keep in mind when preparing your email notifications or newsletters: from the maximum size of file attachments and HTML part to the email client your recipients will most likely use. Also, there are some not so obvious factors, which impact the actual email size and deliverability. In this article, we have gathered replies to the most common related questions:

- What is the recommended size for the email body and attachments?
- What are the limits of different email clients and sending providers?
- How do the embedded images affect email size, spam score, and deliverability?
- What are the common issues and errors related to email size and how to handle them?

Also, we have implemented an email size limit for Mailtrap: let’s review how it works and how it can help you with testing your [email deliverability](https://mailtrap.io/blog/email-deliverability/).

{% embed https://www.youtube.com/watch?v=5tKtVuT-MGE %}

## Types of email size limits
Email size limits are used for three main reasons:

1. **Performance.** Email systems are not designed to transfer large volumes of data. They deal with SMTP, which is a quite outdated protocol. Most of the systems are not able to process multiple data sources at once. In addition, [mail transfer agents](https://mailtrap.io/blog/mail-transfer-agent/) often scan incoming data for viruses and other potential risks, which also takes resources and affects system performance.
2. **Database/storage size.** Email data should be stored on a server (either cloud or local). This is why not only the message itself but also the inbox as a whole has its own limits.
3. **Security.** Points 1 and 2 on our list also lead to potential security vulnerabilities. Email systems usually use a limited number of ports to retrieve data. This makes them candidates for DoS (denial of service) attacks: a huge amount of large messages can take the whole system down. This is also known as an [email bomb](https://en.wikipedia.org/wiki/Email_bomb).

When preparing either transactional or marketing emails, you should consider two limits:

- limit to send a message (your email system)
- limit to retrieve a message (your recipients’ mail system).

For example, if your email service is able to send messages up to 15 MB but the email recipient can retrieve messages only up to 10 MB, it’s obvious that your email should not exceed 10MB. Otherwise, the email will be rejected. It is useful to know the allowance for your recipient’s incoming messages.

If you work with a big database of email addresses to send transactional or marketing emails and don’t have such details about your recipients, you should **follow a general rule: send messages that don’t exceed 10 MB**.

**Limits for popular email sending providers and clients like Gmail, Outlook, Sendgrid, etc.**

![Email clients size limits](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8c0wuyuzj1qmhzxni4r5.png)

![ESPs size limits](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/79c9vqwryam2o1kjcjtb.png)

You can see that most email clients are capable of retrieving 20 – 25 MB of email data. It’s a pretty rare situation when you need to send a mass email with large attachments. But it is still possible when you send numerous booking or order confirmations, for example. However, besides general deliverability, there are few more concerns related to sending large messages. Spam score and rendering issues are the most important. Moreover, some ESPs like Postmark have additional limits for the email body size.

## What else should you consider about the size of your email?
Taking care to create a message that will be successfully delivered to your recipients, you should also think of which folder it will go to, how quickly it will be delivered, and how happy your recipients will be.

### Spam score
[Avoiding spam filters](https://mailtrap.io/blog/avoid-spam-filters/) and targeting the main folder of your recipient’s inbox is one of the trickiest things in email handling. You won’t find strict and ubiquitous criteria for spam detection. However, there is a list of common “anti-spam” rules, and the size-related points are at the top of it.

Technically, there is no message body limit in the [SMTP protocol](https://www.rfc-editor.org/rfc/rfc1870). Still, some providers have their own limits. For example, Postmark allows the HTML and text parts each to be 5 MB, while Gmail clips the body of messages over 102 KB.

Many tests by various providers prove the correlation between email size and deliverability. In most cases, messages with a body over 100 – 150 KB trigger spam filters. So, the **common recommendation is to keep email body size between 15 KB and 100 KB.**

### Rendering issues
Another aspect of large emails is their loading and/or rendering speed. Your recipients do not always have access to a high-speed connection, and a long-lasting message loading process might cause irritation. In addition, in many email clients, a large email body might be rendered just partially, and your recipient will see just parts of images or clipped content. This might strongly harm your customer digital experience and leave a bad general impression.

Notwithstanding the numerous limitations and hidden constraints, there are common rules on building well-performing emails. The first of these is to decrease and optimize email body size.

## What does affect the email size and how can you optimize it?

Each element of the message and the way it’s implemented impacts email size.

**Attachments**. With attachments everything is straightforward. These are enclosed files and don’t affect the email body size. The total email limit usually includes all of the attachments. The best option is to upload files you need to transfer to the cloud and put a link into your message. Due to security issues, many file types are blocked or are considered dangerous (including .doc, .xls, and .pdf).

**Images and other embedded elements**. Even simple notifications usually contain images, at least your company logo. Their size depends on the image format and the way the image is embedded into the message. We had a closer look at this topic in **[this article](https://mailtrap.io/blog/embedding-images-in-html-email-have-the-rules-changed/)**. In short, wherever possible, link to an image hosted on an external server (in the HTML, so it will be displayed as part of the message).

**Encoding**. [MIME-encoded](https://en.wikipedia.org/wiki/MIME#Content-Transfer-Encoding) (base64) messages add 33% to your email size. Keep this in mind when coding a multipart message.

**Other**. Every single message element affects its general size. Message headers, signatures, formatting – all of these add extra kilobytes.

## Rules of a perfect email
Considering the above mentioned limits and dependencies, we have created a short email size optimization checklist. Here are the best practices for building a well-performing email in terms of size:

1. Keep the email body from 15 KB to 100 KB.
2. Don’t add attachments over 10 MB. If possible – upload your files to the external server and make them available online/ for download using a link.
3. Don’t overuse images, GIFs, and other multimedia content.
4. Remember that almost 42% of emails are opened on mobile devices. Keep this in mind when creating email templates. They should be responsive. Using a [responsive email](https://mailtrap.io/blog/best-email-frameworks/) framework or an email builder can save you nerves and kilobytes.

## Check email size in Mailtrap before sending
Even if you followed all recommendations and have crafted the perfect message, checking its size is not an easy task. Whether you are coding a message in your app or preparing a template to send via Gmail, you need to use a third-party tool, actually send your message, or download it then to explore its size.

If you use [Mailtrap](https://mailtrap.io/) for testing your emails before sending them to your real recipients, you can easily check both the email body and attachment size.

![mailtrap email size](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8wli6owqukg31kcp5oht.png)

As soon as your test message is trapped in your virtual inbox, the total email size is displayed along with the message headers. If your message has attachments, you will see a list of them with file names and sizes.

Also, Mailtrap has email size limits, which depend on your billing plan. You can test messages up to 5 MB (total email size with attachments) for free. The maximum possible email size to test is limited to 25 MB.

## SMTP errors related to email size
Instead of offering a conclusion, let’s review the most common SMTP errors related to the mail size. There are two of them:

![SMTP errors](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ia9bwkdruht9ap44kwom.png)

SMTP codes will be completed with additional numbers and messages so you will be able to understand the exact reason. The general rule is to keep your email size as compact as possible, check, and test it before sending to real recipients. 

___

That's it! Thank you for reading our guide on how to optimize [gmail email size](https://mailtrap.io/blog/email-size/). The article was initially published in the Mailtrap blog by Andriy Zapisotskyi.