sodcalculator

10 Tech How-To

Where to Host Images for HTML Email

Guide 10-20824 · Updated · Step by step

Host your email images on a dedicated image hosting service or a CDN that provides a direct, stable URL, such as Cloudinary, Imgur (for casual use), or your own web server with a CDN. You need a publicly accessible URL that does not change and can handle high traffic when your email is opened by many recipients at once.

Why You Can’t Just Attach or Embed Images

Email clients do not allow you to embed images directly into the HTML of an email. When you “embed” an image, you are actually attaching it as a file, which most clients will display as a separate attachment, not inline. Similarly, base64-encoding an image directly into the HTML is technically possible but bloats the email size dramatically and is blocked by many major clients (like Gmail and Outlook). The only reliable way to show an image in an HTML email is to reference it via a <img src="https://your-host.com/image.jpg"> tag, where the URL points to a publicly accessible file on the internet.

How Email Image Hosting Works

When a recipient opens your email, their email client sends a request to the URL in the src attribute. The server hosting that image then delivers the file to the client. This is why the hosting service must be:

  • Publicly accessible – no login or firewall blocking the request.
  • Stable – the URL must not change or expire after a short time.
  • Fast and reliable – if the server is slow or down, the image appears broken.
  • Scalable – if thousands of recipients open the email at once, the server must handle the traffic.

Most email marketing platforms (like Mailchimp, Constant Contact, or Sendinblue) offer built-in image hosting for this purpose. They upload your images to their own CDN and give you a URL to use in your campaign. This is often the easiest solution if you already use such a platform.

Key Factors in Choosing a Hosting Service

Not all image hosts are equal when it comes to email. Consider these factors:

  • Direct link support: Some hosts (like Imgur) provide direct image URLs, but others (like Google Drive or Dropbox) give you a sharing page, not a direct image file. You need a host that serves the raw image file with a .jpg or .png extension.
  • Hotlinking allowed: Some hosts block hotlinking (using the image on another site) or add a referrer check. Make sure the host allows hotlinking from email clients.
  • File size and format: Most email clients support JPEG, PNG, and GIF (including animated GIFs). Avoid BMP or TIFF. Keep file sizes under 200 KB for faster loading.
  • HTTPS support: Many email clients block images served over plain HTTP. Your host must provide an HTTPS URL.
  • Expiration: Some free hosts delete files after a period of inactivity. For transactional emails (like receipts), you need a permanent URL.

Top Hosting Options Compared

Here’s a realistic comparison of common choices:

  • Email marketing platform’s built-in host: Easiest, designed for email, but you are tied to the platform. Good for campaigns, not for transactional emails.
  • Cloud CDN (Cloudinary, Imgix, AWS S3 + CloudFront): Professional, scalable, supports dynamic resizing. Requires some setup and costs money after free tier.
  • Free image hosts (Imgur, PostImage): Fine for testing or low-volume, but they may compress images or have terms that restrict hotlinking. Not recommended for production email.
  • Your own web server: Full control, but you need to manage bandwidth and uptime. If you have a website, you can create an /images folder and upload files there.

Common Problems and How to Avoid Them

The most frequent issue is “broken images” in the recipient’s inbox. This usually happens because:

  • The host blocks hotlinking: The image loads in a browser but not in the email client. Test by opening the email in a few clients.
  • The URL is not HTTPS: Gmail and Outlook will block images from HTTP URLs by default. Always use HTTPS.
  • The file is too large: Large images slow down loading and may be truncated. Compress images to under 200 KB.
  • The host is slow: If the server takes more than a few seconds to respond, the email client may give up. Use a CDN.
  • Image blocked by default: Many clients (like Gmail) block images by default until the user clicks “Display images.” You can’t prevent this, but you can use alt text to convey the message even if images are blocked.

Costs and Free Tiers

Costs vary widely. Free tiers exist on Cloudinary (up to a certain number of transformations) and AWS (12 months of free tier). Imgur is free but not intended for hotlinking. Email marketing platforms usually include image hosting in their subscription. If you are sending a few hundred emails a month, a free tier is often enough. For large volumes, a CDN like Cloudflare (free tier) or Amazon S3 (pay-as-you-go) is cost-effective. Always check the current pricing on the provider’s website, as it changes.

Safety and Privacy Considerations

When you host images, you are making them publicly accessible. Anyone with the URL can view the image. Do not host sensitive information (like a customer’s personal data) as an image. Also, be aware that some email clients track when images are loaded, which is how senders know you opened the email. If you are the sender, you can use this to measure engagement, but you must respect privacy regulations like GDPR. For the recipient, disabling image loading is a common privacy measure.

Alternatives to Hosting Images

If you want to avoid hosting images altogether, consider using:

  • Inline SVGs: Not supported in all email clients, but some (like Apple Mail) do support them.
  • CSS shapes and gradients: You can create simple visual elements (like buttons) using pure CSS, which are not blocked.
  • Unicode characters and emojis: For simple icons, these are universally supported and don’t require hosting.
  • Background images: Some email clients support CSS background images, but not all. Use with caution.

These alternatives reduce reliance on external hosting but may not match the visual richness of actual images.

Frequently Asked Questions

Can I use Google Drive or Dropbox to host email images?

No, because they provide a sharing page, not a direct image file. Even if you get a direct link, it often includes a preview wrapper, not the raw image. Some services allow you to force download, but that will not display inline in an email.

Why do my images show as broken in Gmail but work in a browser?

Gmail blocks images from HTTP URLs and also blocks images from domains that are not on its safe list. Ensure your image URL is HTTPS and that the host is not known for spam. Also, Gmail caches images, so if you update the image at the same URL, recipients may see the old version.

How do I make my images load faster in email?

Compress your images to reduce file size (use JPEG for photos, PNG for graphics). Also, specify width and height attributes in the img tag so the email client can reserve space. Use a CDN with servers close to your recipients.

Is it better to host images on my own domain?

Yes, because it builds trust – the recipient sees your domain, not a third-party one. However, you need to ensure your server can handle the traffic and has an SSL certificate. If you use a dedicated IP for sending email, you can also use the same domain for images, which helps with deliverability.

What is the best free image host for email?

There is no perfect free host. Imgur is popular but may compress images and has terms against hotlinking for large volumes. PostImage is designed for forums and email, but it may have ads. For serious email, a free tier of a CDN like Cloudinary is more reliable.

Can I use a data URI (base64) to embed images?

Technically yes, but it is not recommended. Base64 images increase email size by about 33%, and many email clients (Outlook, Gmail) strip them or do not render them. It also makes the email source code unreadable. Stick to hosted images.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →