For reference, here’s the above sample Markdown, but with the image base64 encoded into the content.
Example Markdown with Image Base64 encoded (Raw)
Some e-mail title here
# Dear Friends
In this email, I will attempt to render an image, with the help of my friends. I also have a list:
1. Item 1
2. Item 2
3. Item 3
And here is the image with some text wrapped around it:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus eget neque nec ipsum ultrices ultricies et a tellus. Quisque molestie leo purus, vitae imperdiet orci. Pellentesque mauris turpis, eleifend at lobortis eget, lacinia vitae lectus. Praesent nec elit nunc, nec molestie nisl. Suspendisse facilisis mi vitae nisi sollicitudin ut imperdiet elit rhoncus. Etiam interdum cursus purus, ut pharetra enim adipiscing faucibus. Nulla malesuada aliquam sollicitudin.
<img src="data:image/png;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBwgHBgkIBwgKCgkLDRYPDQwMDRsUFRAWIB0iIiAdHx8kKDQsJCYxJx8fLT0tMTU3Ojo6Iys/RD84QzQ5OjcBCgoKDQwNGg8PGjclHyU3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3N//AABEIAHcAdwMBIgACEQEDEQH/xAAcAAABBQEBAQAAAAAAAAAAAAAAAwQFBgcBAgj/xAA7EAABBAECAwQIBAQGAwAAAAABAAIDBBEFIQYSMRNBUWEHIjJxgZGhsRQVctFCQ8HwI1JTYnPxFhcz/8QAGgEAAgMBAQAAAAAAAAAAAAAAAAQCAwUBBv/EACQRAAMAAgICAgIDAQAAAAAAAAABAgMRBBIhMRNBFDJRYYEF/9oADAMBAAIRAxEAPwDcUIQgDhKqut8TPinfX04NJbs6QjO/kp3WpnV9JtzR7OZE4g+CxPinVZ6sUVarIY3ygufI3Y46YB7vekeVktNY48NjnFxS07rykXF/EmsxP5haz5OjaQfopbSuN4nns9Wi7E/60YJafeOo+qyHQPzGzc/w7czYmbylzuYEeGDtkqxzkZKU+XLhrXbY58OLLP66LtqPpEpwkto0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empus orci at fringilla. Nullam at pulvinar orci. Phasellus tempor, turpis ac iaculis sagittis, sem nunc elementum nunc, placerat pulvinar urna dui quis enim. Etiam sollicitudin pretium tempor. Ut cursus rhoncus odio, sed eleifend risus pretium eu. Fusce eu enim quis nisi pellentesque lacinia. Nulla faucibus blandit orci eu viverra. Donec vestibulum tempus facilisis. Ut et justo quis massa suscipit feugiat. Phasellus sagittis scelerisque tincidunt. Donec diam quam, semper eget aliquam vel, vehicula vitae erat. Morbi tortor mauris, sodales id tristique vel, feugiat vitae tortor. Etiam a elit nunc, id malesuada diam. Nam nisi mauris, luctus nec sodales vitae, mollis eu risus.
Sed in nunc nulla, at convallis nisi. Suspendisse consequat euismod vestibulum. Donec dictum, est et feugiat faucibus, metus nisl pellentesque enim, a posuere orci lectus volutpat mi. Praesent lectus lorem, sodales sit amet accumsan a, placerat quis est.
Thanks in advance for your help
Example Markdown with Image Base64 encoded (Rendered)
Some e-mail title here
Dear Friends
In this email, I will attempt to render an image, with the help of my friends. I also have a list:
- Item 1
- Item 2
- Item 3
And here is the image with some text wrapped around it:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus eget neque nec ipsum ultrices ultricies et a tellus. Quisque molestie leo purus, vitae imperdiet orci. Pellentesque mauris turpis, eleifend at lobortis eget, lacinia vitae lectus. Praesent nec elit nunc, nec molestie nisl. Suspendisse facilisis mi vitae nisi sollicitudin ut imperdiet elit rhoncus. Etiam interdum cursus purus, ut pharetra enim adipiscing faucibus. Nulla malesuada aliquam sollicitudin.
Nullam ac magna lectus. Phasellus rhoncus tempus orci at fringilla. Nullam at pulvinar orci. Phasellus tempor, turpis ac iaculis sagittis, sem nunc elementum nunc, placerat pulvinar urna dui quis enim. Etiam sollicitudin pretium tempor. Ut cursus rhoncus odio, sed eleifend risus pretium eu. Fusce eu enim quis nisi pellentesque lacinia. Nulla faucibus blandit orci eu viverra. Donec vestibulum tempus facilisis. Ut et justo quis massa suscipit feugiat. Phasellus sagittis scelerisque tincidunt. Donec diam quam, semper eget aliquam vel, vehicula vitae erat. Morbi tortor mauris, sodales id tristique vel, feugiat vitae tortor. Etiam a elit nunc, id malesuada diam. Nam nisi mauris, luctus nec sodales vitae, mollis eu risus.
Sed in nunc nulla, at convallis nisi. Suspendisse consequat euismod vestibulum. Donec dictum, est et feugiat faucibus, metus nisl pellentesque enim, a posuere orci lectus volutpat mi. Praesent lectus lorem, sodales sit amet accumsan a, placerat quis est.
Thanks in advance for your help
In terms of what happens, mail client apps receive the mail source and then choose how to process it. The vast majority of clients will choose to render the HTML by default.
However, since online marketers started using “web beacons” many mail clients started including options not to load images by default from untrusted sources; you can opt to mark a source as trusted in an app. This should apply to external images only (ie. not the base64 encoded image), but it is entirely possible that this varies from mail client to mail client based on how the developers choose to code any opt-in.
In my opinion a good developer should have coded for external images only and be protecting the user from tracking which a purely internal image would not enable. Any argument to malformed rendering and security considerations suggests the app should not support any rich text or attachments either.
For mail clients that do not support images (welcome command line junkies) then the app should provide the plain text part of the mail and not the image or in fact any of the rich formatting. They usually include the “real” mail as a MIME part attachment (rather than a link, auto-downloaded attachment, etc.) if I recall correctly, that you could then save off. It’s been a while since I regularly used a plain text mail app - though Martin, you might appreciate that the last one I used with regularity was called MEMO running on an OS/390 I think; it may have been z/OS towards the end of using it at a green screen terminal, I can’t recall exactly.
Overall, I think it all eventually comes down to MIME attachments and an effort to offer plain text always as that is really what e-mail is under the hood right now - everything else is built on top rather than integrated in … I think, but email engineering is not my forte. I’m pretty sure it comes back to the introduction in the mid-nineties of RFC 1563 and perhaps to this particular statement: