Base64 image works in Desktop Outlook but not on Web Outlook

Anonymous
2019-03-20T00:07:11+00:00

Split from this thread.

I have the same problem.  I'd like to use an embedded base64 image as a disclaimer in emails (because it doesn't mess with the subject or message preview in outlook).  Setting that up was easy, but now when users forward those messages, outlook mangles the original html and the picture never displays.  If I view the message source it will look like:

<img src="data:image/png;base64,iVBORw0KGgo...somestuffgoeshere...">

When outlook receives a message like that it displays correctly, but when I forward an email like that, outlook changes the html img tag to use a local temp file that doesn't exist:

<img width=376 height=134 style='width:3.9166in;height:1.3958in' id="_x0000_i1025" src="file:///C:/Users/username/AppData/Local/Microsoft/Windows/INetCache/Content.MSO/10893E52.tmp">

If I go into my sent mail to view the forwarded message you'll just see thumbnail that says "The linked image cannot be displayed.  The file may have been moved, renamed, or deleted.  Verify that the link points to the correct file and location." instead of the image that was there previously.  

Here's an easy way to test:  create a mail flow rule that applies if the recipient is you and select "prepend the disclaimer" with this in it:

<div><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAXgAAACGCAMAAADgrGFJAAABgFBMVEUEBwf6+uo4U6Tz7BlpvUX///+5UZ/tHyRuzd0AAADz7S01Tpv5+dv6+uxpvktuzNXCSIrsAADd50vlw9wAAAe2SZvYosljuzxtxEc0UKNSabCt2pzvHiLz6wDbJTNiwzy+RqRNTpeMPnl6NmnAVKVAHTi0GBxSDQ+dFRn+6OmW2ub07kgoRxs2YCXD6vHsDBRlvMoyXGPn4Rj59pvY0hcVFggUJSixrBM1NQrc8/bGebL68fj1ioxXo6/yb3Fdpz0lN20bMjYrP30UHjn5x8j59qtqerX5uLnesdIhPBmv4uyJyXFGfS5QkDXwXV/3831Li5YMFhe/YqgXKRGrtdaBx2Pt1Ob3n6Du8fhVnqr0g4XvPUHe8Nb83d4qTlRBeoMQHQ73qKqe04rwTVHj8t2/4bPN6MGj1ZCUN2mSzXxKlC5taw59hC1CQASYlBJYVwzIwxaorzkmJwmRGSJBgShQtRk+byrhYGcvVSH5wcJ+jcEcMhULEh7YJD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71/Tm3t5eU6qSqeCn+BUVT/MQhl0v8ZFz0aH8yLkv8cdNImySaVDjJ2+cadjOpI6JijA/Xm832G3PIrOxSQeHzSYrlHi8/ez3QeL7zwPFv79yx3vXF54sA6HpHtNrRJo27rywDIEPQs2x7+DwQjGY/BFofzJZCvZRolIElPH8/NfXEv4kvrDw5tXLE/p++gRlHvL7FveYcb5ZsQmKwlyDOa2iueEPIzGa1xMv0Pbzq4f3/vz1hL9/Mj8/PzYt7JmeP/lXrVaTSvETuXzNvS/HysVCrwYF3Z4U3xQ2eRx/Fii+/1Og+Pyrr11xPVONKvr+YelBrq03h/Ti+qvAh+5Odg6AB3iAB3iAB3iAB3iAB3iAB3iAB3iAB3iAB3iAB3iAB3iAB3iAB3iAB3iAB3iAB/jrAf8LFWTzMFsWtkAAAAAASUVORK5CYII="></div></br></br>  

After the mail flow rule kicks in, you'll receive emails with a test image prepended.  If you forward the message with Outlook, Outlook will break it.

Outlook | Windows | Classic Outlook for Windows | For home

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
Answer accepted by question author
Anonymous
2019-03-25T15:08:24+00:00

Hello Michael,

I have done more tests on it and here is what I found.

Adding images by this way contradicts with MIME specification, that is the reason why it is not working. The disclaimer rule directly inserts the codes to the HTML body:

<body lang=3D"EN-US" link=3D"#0563C1" vlink=3D"#954F72">

<div><img src=3D"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAXgAAACGCAMA=

AADgrGFJAAABgFBMVEUEBwf6……………

But the images in an email should be inserted as following way according to MIME:

src=3D"cid:[email protected]"></span></a><o:p></o:p></p></di=

v></div></body></html>

------=_NextPart_001_0060_01D4DF2C.50750B70--


------=_NextPart_000_005F_01D4DF2C.50750B70

Content-Type: image/png;

name="image001.png"

Content-Transfer-Encoding: base64

Content-ID: <[email protected]>

I tried to replace the code with the following HTML code: <div style="font-size:8pt; font-family: 'Calibri';"> CONFIDENTIALITY NOTE: Disclaimer info.</div>. When I forwarded the email, it still show as normal.

Regarding to your problem, as a workaround, it is suggested to try other methods to add the message as a disclaimer. For example, you can insert the image directly to emails, or create a email template. Thanks for your understanding.

Regards,

Rick

Was this answer helpful?

0 comments No comments

4 additional answers

Sort by: Most helpful
  1. Anonymous
    2019-03-21T15:33:26+00:00

    We don't currently have any kind of external storage to use for this purpose.  Because I'm using the original email and prepending a disclaimer I don't have access to MIME either -- I can add html, but I rely on Outlook to process it correctly.  The fact that it does initially and then breaks itself if you hit forward has got to be a bug with outlook, but I'm hoping there is a workaround that can be found using exchange mail flow rules or by doing something with the html.

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2019-03-27T15:32:11+00:00

    Hello Michael,

    I'm writing to follow up the thread. If you have any other problems, please feel free to post a new thread in the forum. 

    Regards,

    Rick

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2019-03-21T07:37:45+00:00

    Hello Michael.

    Thanks for your patience. During my research, I found a workaround that may work better in the initial thread, which was to upload the image to Azure Storage and serve it from there.

    This is how to created it though:

    string encoded = “data:” + file.ContentType + “;base64,” + Convert.ToBase64String(System.IO.File.ReadAllBytes(location));

    You can try it to see if it can meet your requirement.

    Regards,

    Rick

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2019-03-20T07:26:28+00:00

    Hello Michael,

    Thanks for your post in the forum. I have done some tests using the source code your provided and found some similar behavior. In order to help you better, I need to do more consult and tests on my side. Once there is any update on it, I will let you know as soon as possible.

    Thanks for your understanding and patience.

    Regards,

    Rick

    Was this answer helpful?

    0 comments No comments