You may have heard that a picture is worth a thousand words. For HTML emails, Images are important to convey your message Increase engagement with your subscribers.
However, embedding images in HTML e-mail can be difficult, especially with various e-mail clients and devices.
This guide will show you various techniques for embedding images in email. CID embedding, inline embedand linked image.
You’ll also learn best practices for optimizing image formatting and size, adding alt attributes, and testing emails before sending.
By the end of this post, you will have a better understanding of how to effectively embed images in HTML emails to make them stand out and get results.
What is HTML email?
With HTML emails, you can: include images others multimedia content on mail. It’s like an email newsletter, but with the added ability to embed images directly into the body of the message.
No-code email template builder
Postcards allows you to create and edit email templates online without coding skills. With over 100 components included, you can create custom email templates faster than ever before.
More products to try for free
You can use it to create beautiful and engaging emails that will grab the attention of your recipients.
Embedding in HTML emails is a simple process that requires no special skills or software if you know a little bit of code.
Whenever you add multimedia, the relevant elements are called MIME objects.
MIME (Multipurpose Internet Mail Extension) is a standard for formatting emails containing multimedia elements such as images, audio, and video.
By encoding multimedia files as ASCII text and attaching them to messages, MIME allows e-mail to have more than plain text functionality.
SMTP (simple mail transfer protocol) is a way to send email messages between servers. SMTP servers utilize the MIME standard when formatting emails containing multimedia elements.
Each MIME segment contains a content type (“text/plain“,”text/html“,”image/jpeg“, again “video/mp4“), encoding, and other metadata about the content.

There are two basic ways to attach images to your e-mail message:
- Images as attachments
- Embed images in HTML emails
Let’s see how it can help you improve your recipient’s experience.
Images as attachments

Images can be included as stand-alone files that do not affect the HTML structure. This is a simple process, but there are file size limitations.
All email clients have file upload limits.
For example, if you try to upload a file larger than 25MB for Gmail, the file will go to a Google Drive link.
💡 Tips: Please reduce the file size. So the recipient can easily view the attachment.
Embed images in HTML emails

Embedding images directly in the HTML code of your email message is a great way to create visually appealing emails.
There are three main techniques for embedding images in HTML emails:
- CID (Content ID)
- Inline embed or base64 image
- Linked or hosted image
CID (Content ID) attachment
Content-ID (CID) refers to email attachments that allow images and other files to be integrated into the body of the email.
Email clients use the “CID” URL model to identify the Content ID of attachments and display embedded images when viewing messages.
Example JavaScript code:
This code uses the “CID” protocol to reference attachments in the email’s HTML content to define an email message with an image attached.

Inline embed or base64 image
Inline embedding, or base64 encoding, embeds images or binary data directly into HTML or CSS code. You can add images to your web pages without loading the external files separately.
To apply inline embedding, you must first convert the image file to a base64 encoded string. This can be accomplished using online tools or coding libraries.
Once you have the base64 encoded string, you can directly integrate it into your HTML or CSS code using the “data” attribute.

Not recommended for use in email. There are several reasons for this.
- For detailed images, long strings are generated.
- It increases the size of your emails, causing email deliverability and spam issues.
- Some email services, such as Microsoft Outlook, do not display it.
- Once embedded, Base64-encoded content cannot be edited or extended.
So what’s a good way to embed images in HTML emails?
Embedding Links or Hosted Images
To embed images in HTML emails, we recommend hosting your images in a dedicated cloud service such as Cloudinary, Bunny CDN (Content Delivery Network), or Amazon AWS S3.
When you upload a file with either service, you get a link that you can insert into your img tag like this:

Many large companies use this approach with dedicated resource servers.
You can also use the server your website is hosted on, but make sure your images load fast. Failure to do so may result in poor recipient experience.
Best practices for embedding images in HTML emails
Before launching an email campaign, there are some practices to consider.
There are no hard and fast rules, but just keeping these tips in mind will help you create great email templates.
- Use linked or hosted images instead of base64-encoded strings for better deliverability and scalability.
- Optimize images for the web to reduce size and improve load times.
- Use the alt tag to provide a textual description of the image for accessibility purposes.
- Test your email with different email clients and devices.
- Consider using a responsive email design so your images look good on different screen sizes.
- Be sure to use the correct image format. JPEG is recommended.
- Always use a tool instead of creating an email newsletter template from scratch.
Use postcard no-code email builder
So far, you’ve learned about different methods of embedding images within HTML. But have you seen the problems you can face when creating email templates with images?
What if you shared a tool that helps you compose emails without worrying about email client limitations, service providers, and recipient devices?
Introducing postcards. This is a no-code email builder fully tested with popular tools like Litmus and Email on Acid.
Several features make it an ideal solution for marketing campaigns.
- Drag and drop a builder containing options to change the values.
- A powerful text editor to enhance your writing and editing experience.
- Version history for proper backup of previous files.
- Manage your content using the visual editor and enhance your text, links, and images.
- Use cloud image hosting to host email images on your server.
- Clean code that is easy to understand and customize.
- Fully responsive emails optimized for all devices.
- Export unlimited templates.
- Collaborate with your entire team without worrying about missing team members.
- Support for external images makes linking self-hosted images easier.
Simply put, using Postcards to create HTML email templates is a smart decision for developers and email marketers who want to streamline their workflow and improve the visual appeal of their messages.
Postcards makes it quick and easy to create professional-looking templates optimized for maximum deliverability and engagement.
A complete solution to make your email templates faster, better and more secure.
Why not try it out and see how it can help you take your email marketing to the next level?
FAQ
How can I ensure that images display properly across email clients and devices?
There are several steps.
- Use a reputable email service provider that offers responsive email templates, such as Postcards.
- Optimize your images for faster loading and double check the correct file format. Additionally, include alt text for all images to provide context in case they fail to load.
- Before sending an email, test it in different email clients and devices to make sure everything looks fine.
Are there any potential drawbacks to embedding images in HTML emails, such as increased blocking by spam filters?
Yes, embedding images in HTML emails increases the chances of your email being marked as spam. Additionally, some email clients may block images by default, resulting in poor user experience for recipients.
To avoid these issues, consider hosting your images on a trusted server.
Instead of embedding the large image directly in the email, you can also provide an additional link to view the image in your web browser.
What is the difference between embedding an image and attaching it to an email?
Embedded images appear directly in the body of the email, while attached images are sent as separate files that the recipient must download.
Embedding can improve the visual appeal of your email, but it can also (depending on your approach) increase load times.
Attachments can provide higher resolution images, but can also increase the risk of your email being marked as spam.
Ultimately, choosing between embedding and attaching depends on your specific email needs and intended audience.
How can I test images in HTML emails?
To test the image in your HTML email, first send yourself a test email and see if the image loads correctly. We also recommend using online tools such as Litmus, Email on Acid, and Everest to test your email on different clients and devices.
Please check the file size. Large files can lead to slow loading times or not loading completely.
How can I embed images in HTML emails in Outlook?
To embed an image in an HTML email in Outlook, open a new email, click[挿入]Click a tab. Then click Photos and select the image you want to embed from your computer.
After inserting the image, make sure its size is suitable for your email.
Test your email to make sure your images display correctly in different email clients. These steps successfully embed images in HTML emails in Outlook.
Why are images blocked in emails?
Images in emails can be blocked for security reasons, such as to prevent spam and phishing attempts. Some email clients automatically block images by default, requiring users to click the image to view it manually.
It can also be blocked if the image is hosted on an untrusted server or hosted without SSL.
Providing a text-based version of the email, including alt text, may help to ensure that important information is communicated even when images are blocked. Recipients can understand the content even if the image is not displayed.
Should you use images in your email marketing?
Yes, images can be a powerful tool to enhance your email marketing campaigns. It helps grab the attention of your recipients and make your emails more visually appealing. However, it is important to use images strategically. Don’t overload your email with too many visuals.
Are linked images in HTML emails considered MIME objects?
Yes, linked images in HTML emails are also considered MIME objects.
When an email client views the message, it says “sauce‘ attribute of the ‘img’ tag. The image file is treated as another her MIME object and displayed in the email.
In this case, the image file is not attached directly to the email message as it is with embedded images using the “CID” URL scheme.
However, it is still considered a MIME object as it is separate content that must be retrieved and displayed by an email client.