Embed images when sending HTML E-Mail
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 36.9k
- Forks
- 5.2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 713
Description
external resources are not automatically loaded in sanely configured E-Mail clients.
For example in Thunderbird a warning like this will pop up:

the NextCloud logo is fetched from https://yourserverhere.com/core/img/logo.png?v=3D0 which is opens the door for resource based tracking.
It's not just the NextCloud logo but all image resources. For example in an mail based invite the small icons like
and
will not be displayed when viewed in a many E-Mail client (for example Thunderbird with default settings)
Why change this?
- privacy (readers can be sure that the NC admin does not track them)
- usability (readers can see the images without clicking away a warning prompt)
Is this technically possible?
- Yes, you can embed images. For example via MIME Content-ID or via inline embedding
Technical Example
Black and white image reading "Hello" is inserted into an HTML E-Mail via Content-ID. The image is base64 encoded inside the E-Mail
Return-path: <user@example.com>
Received: ...
Original-recipient: rfc822;user@example.com
Sender: user@example.com
To: Me <user@example.com>
From: Me <user@example.com>
Subject: Test
Message-id: <123e4567-e89b-12d3-a456-426655440000@example.com>
Date: Sun, 13 Jan 2019 00:00:00 +0000
MIME-version: 1.0
Content-type: multipart/alternative;
boundary=------------63E36A7002E8D6FBEB9C5425
Content-language: en-US
This is a multi-part message in MIME format.
--------------63E36A7002E8D6FBEB9C5425
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
--------------63E36A7002E8D6FBEB9C5425
Content-Type: multipart/related;
boundary="------------885E82E985699C9CB72624B8"
--------------885E82E985699C9CB72624B8
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<img src="cid:part1.1389FB42.0D8EC5D1@example.com" alt="">
</body>
</html>
--------------885E82E985699C9CB72624B8
Content-Type: image/png;
name="poclpdkelpocpgpa.png"
Content-Transfer-Encoding: base64
Content-ID: <part1.1389FB42.0D8EC5D1@example.com>
Content-Disposition: inline;
filename="poclpdkelpocpgpa.png"
iVBORw0KGgoAAAANSUhEUgAAADgAAAASCAIAAACB04oZAAAAzUlEQVRIie2T0REDIQhEqYuC
qIdqaGaLMR9Rz1PGU+NMLpPbP0HXByKFHxF9G2BU/whqQlGsmMxeqwTNXqwIAcpxKTbjCOUO
Sj87CBptysCC7S1ATVKXiZjFvBsXQaGHN0u7ZQIUyiyGvDRldqZiBdTkHIVJbd2AUqVsYNIO
qxdbAHViTcuGO+rUEAv5GNQrtwmOPz08u0GUi+zWjoY0SYcjTHnL09fOQDv+VO4+zWXx1vkM
TMt/L3qY+aORTvaz7x0zv/7GekB36wHdrRcZX4h7tVmUbQAAAABJRU5ErkJggg==
--------------885E82E985699C9CB72624B8--
--------------63E36A7002E8D6FBEB9C5425--
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files, tests, or entry points are named in the issue. Begin by locating the server's HTML email generation and MIME assembly, then trace how image resources are referenced; done means outgoing HTML email images are embedded rather than fetched externally, including the logo and invite icons.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend, security
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100