I grepped around in the ImapX source code and cannot find any code that replaces
I suspect that what is happening is that you are grabbing the
That said, a browser control will not render
That example saves the referenced images off to a temp directory and references them using a
img
tags with a string like what you provided.I suspect that what is happening is that you are grabbing the
text/plain
message body instead of the text/html
message body.That said, a browser control will not render
img
tags with a cid:
source URL. In order to get those img
tags to render properly, you'll need to use something like the HtmlPreviewVisitor
mentioned at https://github.com/jstedfast/MailKit/blob/master/FAQ.md#HasAttachments (scroll down a few paragraphs).That example saves the referenced images off to a temp directory and references them using a
file://
URL, but the other option is to embed the image data in the HTML like this:string GetDataImageSrc (MimePart image)
{
using (var output = new MemoryStream ()) {
image.ContentObject.DecodeTo (output);
return string.Format ("data:{0};base64,{1}", image.ContentType.MimeType, Convert.ToBase64String (output.GetBuffer (), 0, (int) output.Length));
}
}