Android Question Display Mime email containing base64 images in a WebView

William Hunter

Active Member
Licensed User
Longtime User
I can extract the message body, left and right pad it, then display it as HTML in a WebView. This will display the message text and the place holders for the images. What I don’t know how to do, is to deal with the base64 string.

I have attached two files. The first is the email source. The second, Base64Test2, is my extracted HTML with the extension changed to txt. The source contains a base64 string consolidating two images. How do I extract the message body and the base64 string? Then have the two images displayed in their place holders?

If a fellow forum member has experience doing this, and are willing to share their knowledge, their help in the form of a code example, would be greatly appreciated.

Regards :)
 

Attachments

  • Base64Test.txt
    69 KB · Views: 247
  • Base64Test2.txt
    1.4 KB · Views: 226

William Hunter

Active Member
Licensed User
Longtime User
See MailParser code. It extracts attachments.
Thank you Erel. I had forgotten that Mailparser extracts attachnents, although only for those messages parsed as MultiPart. As MailParser doesn't support all the possible mail formats, specifically multipart/alternative, I have been extracting HTML code another way. This seems to work well, except when certain image types are involved.

While I could add a little extra code in my method to extract images, importing the images into HTML is beyond my skill level.

Regards
 
Last edited:
Upvote 0
Top