Linked image to embedded image

+1 vote

I am looking for a solution how to convert linked image to embedded image in mail body. I would like to forward message using limilabs mail.dll but content loosing images because of linked images. Anyone have any idea how to solve it?

asked Oct 26, 2018 by Radek

1 Answer

0 votes
Best answer

Most email clients don't support url encoded images, such as: (src="data:image/png;base64...):

Generally you have 2 options:
1. Use external image server: src="https/"
2. Embed images inside email using cid protocol:

MimeData visual = builder.AddVisual(@"c:\image.jpg"); 
// you can use file or raw bytes (Data property)
visual.ContentId = "";

builder.Html = @"<html><body>
                    <img src="""" />

You can find more info here:

Converting HTML with url encoded images is outside of Mail.dll's

I'd suggest processing HTML using external component like Html Agility Pack.

answered Oct 26, 2018 by Limilabs support (235,630 points)