Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Inline images with EmailReadMessages?

Featured Replies

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--

  • 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.

  • 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--

  • 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

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.