William Hunter Active Member Licensed User Longtime User Sep 28, 2016 #1 I am dealing with an email message having a content-type of text/plain. The text portion is quoted-printable, and there is an inserted image as a base64 image string. Both have been saved as attachments, and have been decoded appropriately. I now have a text file for the text string, and a bmp file for the image. How do I merge these two files into Msg.Body for display in a WebView? Also, in the event there were more than one image, how would this be handled? Any help greatly appreciated. Best regards
I am dealing with an email message having a content-type of text/plain. The text portion is quoted-printable, and there is an inserted image as a base64 image string. Both have been saved as attachments, and have been decoded appropriately. I now have a text file for the text string, and a bmp file for the image. How do I merge these two files into Msg.Body for display in a WebView? Also, in the event there were more than one image, how would this be handled? Any help greatly appreciated. Best regards
Erel B4X founder Staff member Licensed User Longtime User Sep 29, 2016 #2 William Hunter said: How do I merge these two files into Msg.Body for display in a WebView? Click to expand... Are you sending the mails to your app? If so then you can create a html body and include the images as base64 strings inside the html. Upvote 0
William Hunter said: How do I merge these two files into Msg.Body for display in a WebView? Click to expand... Are you sending the mails to your app? If so then you can create a html body and include the images as base64 strings inside the html.
William Hunter Active Member Licensed User Longtime User Sep 29, 2016 #3 Erel said: Are you sending the mails to your app? If so then you can create a html body and include the images as base64 strings inside the html. Click to expand... Thank you Erel. I have no role in the preparation of these messages. They are incoming from a mail server, and have been sent to me by third parties. Best regards Upvote 0
Erel said: Are you sending the mails to your app? If so then you can create a html body and include the images as base64 strings inside the html. Click to expand... Thank you Erel. I have no role in the preparation of these messages. They are incoming from a mail server, and have been sent to me by third parties. Best regards
Erel B4X founder Staff member Licensed User Longtime User Sep 30, 2016 #4 How are the bitmaps referenced from the text? Upvote 0
William Hunter Active Member Licensed User Longtime User Oct 1, 2016 #5 Erel said: How are the bitmaps referenced from the text? Click to expand... Both the text and the image were downloaded as attachments. I have two individual files. 1. The text was quoted-printable and has been decoded to utf-8. 2. The image was a base64 image string and has been decoded to a bmp file. As it stands now the image is not in any way referenced from the text. I simply extracted the two parts from the incoming raw message. It has had no other handling. I am looking for a way to merge the text and image so the compete original message can be displayed in a WebView. I'm doing some experimentation, so this might not be the right approach. I would like to find a way to display the text, and whatever number of images accompanied the text, into a WebView. Regards Upvote 0
Erel said: How are the bitmaps referenced from the text? Click to expand... Both the text and the image were downloaded as attachments. I have two individual files. 1. The text was quoted-printable and has been decoded to utf-8. 2. The image was a base64 image string and has been decoded to a bmp file. As it stands now the image is not in any way referenced from the text. I simply extracted the two parts from the incoming raw message. It has had no other handling. I am looking for a way to merge the text and image so the compete original message can be displayed in a WebView. I'm doing some experimentation, so this might not be the right approach. I would like to find a way to display the text, and whatever number of images accompanied the text, into a WebView. Regards
Erel B4X founder Staff member Licensed User Longtime User Oct 2, 2016 #6 You can save the bitmaps in File.DirInternal and then reference them with: Code: Copy Dim html As String = $" <p>text</p> <img src='file://${File.Combine(File.DirInternal, "yourimage.jpg")}'/> <p>more text</p> "$ Upvote 0
You can save the bitmaps in File.DirInternal and then reference them with: Code: Copy Dim html As String = $" <p>text</p> <img src='file://${File.Combine(File.DirInternal, "yourimage.jpg")}'/> <p>more text</p> "$
William Hunter Active Member Licensed User Longtime User Oct 5, 2016 #7 Erel said: You can save the bitmaps in File.DirInternal and then reference them with: Code: Copy Dim html As String = $" <p>text</p> <img src='file://${File.Combine(File.DirInternal, "yourimage.jpg")}'/> <p>more text</p> "$ Click to expand... Thank you Erel. Is it possible to source the bitmap from a local variable, rather than File.DirInternal? Regards Upvote 0
Erel said: You can save the bitmaps in File.DirInternal and then reference them with: Code: Copy Dim html As String = $" <p>text</p> <img src='file://${File.Combine(File.DirInternal, "yourimage.jpg")}'/> <p>more text</p> "$ Click to expand... Thank you Erel. Is it possible to source the bitmap from a local variable, rather than File.DirInternal? Regards
Erel B4X founder Staff member Licensed User Longtime User Oct 6, 2016 #8 You must save it to a file. Upvote 0