+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?

by

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/yourdomain.com/image.png"
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 = "logo@example.com";

builder.Html = @"<html><body>
                    <img src=""cid:logo@example.com"" />
                </body></html>";

You can find more info here:
https://www.limilabs.com/blog/sending-email-with-embedded-image

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

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

by (297k points)
...