July 6, 201213 yr Hello all, Am evaluating the plug-in for possible purchase (Enterprise license). I need to import sent messages from a mailbox into an FM table every morning. Works well, except that inline images are not showing up in the FM WebViewer; I get blue/white 'image missing' question mark icons where the images should be. Here's a code fragment: EmailReadMessages ( "progress=true" ; "mailbox=Sent Messages" ; "attachments=true" ; "skip=" & ema_PRF__kx::skip ; "readonly=false" ; ) Do I also need to call EmailAttachFileInline? I'm not composing a new html message, I'm just reading/importing existing messages that have already been sent by my users (via their Apple Mail app) so I'm not sure if EmailAttachFileInline is the way to go in this scenario. Any suggestions greatly appreciated! Many thanks--
July 9, 201213 yr Newbies I solved this by parsing the Mail for inline image tags and replacing them with a base64 encoded version of the image (using ScriptMaster for Base64 encoding). Takes a bit more space but works fine. You just can't send it back to Outlook (2007+) clients as DataURIs are not supported there.
July 9, 201213 yr Author I can get an attachment (a small jpeg) from a sent email into a container field. And the html has been read into a text field. But I can't figure out how to make that jpeg appear as an inline graphic in the webviewer. I guess conceptually I'm looking for a way to change src="cid:F119C926-4C71-4558-8005-83E1BF95D671" to src="cid:<the file in the container field"> but obviously html doesn't recognize FM tables & fields. How is it done? Many thanks--
July 10, 201213 yr Newbies Download Scriptmaster. Create the following Function: Function Name:ContainerToBase64 Parameter:fieldName Function: return new sun.misc.BASE64Encoder().encode( fmpro.getContainerStream( fieldName ).getBytes() ); Then use this function to create a Base64 representation from your Container Field Image. It will look something like this: /9j/4QZKRXhpZgAATU0AKgAAAAgADAEAAAMAAAABAJIAAAEBAAMAAAABANkAAAECAAMAAAADAAAA ngEGAAMAAAABAAIAAA... Replace the "¶” characters with "" Parse the email and replace every image with its Container field representation Replace: <img src="cid:F119C926-4C71-4558-8005-83E1BF95D671"> with: <img src="data:image/png;base64,/9j/4QZKRXhpZgAATU0AKgAAAAgADAEAAA..."> and adapt the image MIME type from image/png to image/jpeg for a jpeg image
Create an account or sign in to comment