Sending HTML output as body in MS Outlook with base64 image corrupts the image. #1100
Replies: 2 comments
-
RFC 2822 states that "Each line of characters MUST be no more than 998 characters, and SHOULD be no more than 78 characters, excluding the CRLF." If it exceeds this limit, an exclamation mark will be added in the text. Fixed this by applying soms text-functions to the resulting html output-file
|
Beta Was this translation helpful? Give feedback.
-
Thx for sharing your experience. |
Beta Was this translation helpful? Give feedback.
-
Birt 4.4.2
Rendering a file to HTML with an image so it can be used as an e-mailbody in MS Outlook.
The image is initially embedded in the report design, and is converted to a base64 string using an ImageHandler (Birt standalone runtime)
code used: https://forums.opentext.com/forums/developer/discussion/61437/base64-imagehandler
At first glance, the resulting HTML file looks fine when opening in a browser and the images are showing.
Note that the "img" tag is output as one long string (1 line when opened in a source editor)
However if I try to send the file as a body in MS Outlook the images are corrupted.
It seems like, for Outlook, there is a maximum number of characters that can be in one line.
For (larger) images, an exlamation-mark is added at the end of the encoded string, corrupting the image.
I have tried to encode the base64-image as a chuncked string (76 character blocks).
However when I do that, the resulting birt-HTML file wil still show the Base64-string in one line.
It will just add "(ampersand)#13;(ampersand)#10;" after every chunk.
Is there any way around this?
I'd like the resulting HTML-render to actually have a line-break in the source-code, not the HTML-escape variant.
As a last resort I could just put line-breaks in the source file in Birt RE after the HTML-render is done.
Beta Was this translation helpful? Give feedback.
All reactions