Skip to main content

How do I embed images into HTML emails sent from Lasernet? - Knowledgebase / Lasernet / Lasernet FAQs - Formpipe Support Portal

How do I embed images into HTML emails sent from Lasernet?

Authors list

You can create an email in Lasernet via an XHTML form or by populating the JobInfo ‘MailBodyHTML’ via a script.

Image source

The image source needs to be decided. There are three options:

Option one

Local: an image on a local drive or network. This will only display for recipients with access to this location:

img src="smiley.gif"alt="Smiley face"> img src="/subfolder/smiley.gif" alt="Smiley face"> img src="c:\images\smiley.gif" alt="Smiley face">
Option two

Remote: a remote image on the Internet or Intranet. This is the most common way for images to be embedded into an email.

<img src="http://server/images/smiley.gif" alt="Smiley face" /> <img src="" alt="Smiley face" />

Option three

Embedded: Base64 encoded image data. Note: Not all browsers/email clients can display this. The image will need to be converted using an external tool or via the XHMTL form engine.

<img src="image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAM0AAAD NCAMAAAAsYgRbAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5c cllPAAAABJQTFRF3NSmzMewPxIG//ncJEJsldTou1jHgAAAARBJREFUeNrs2EEK gCAQBVDLuv+V20dENbMY831wKz4Y/VHb/5RGQ0NDQ0NDQ0NDQ0NDQ0NDQ 0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0PzMWtyaGhoaGhoaGhoaGhoaGhoxtb0QGho aGhoaGhoaGhoaGhoaMbRLEvv50VTQ9OTQ5OpyZ01GpM2g0bfmDQaL7S+ofFC6x v3ZpxJiywakzbvd9r3RWPS9I2+MWk0+kbf0Hih9Y17U0nTHibrDDQ0NDQ0NDQ0 NDQ0NDQ0NTXbRSL/AK72o6GhoaGhoRlL8951vwsNDQ0NDQ1NDc0WyHtDTEhD Q0NDQ0NTS5MdGhoaGhoaGhoaGhoaGhoaGhoaGhoaGposzSHAAErMwwQ2HwRQ AAAAAElFTkSuQmCC" alt="Beastie" />

Once the image source has been decided, then the image can be added to the email using one of the following two ways:

XHTML Output Form

XHTML output format requires the XML Output licence option (contact our sales department if you need this functionality). Once this is done, follow these steps: 1. Set the Input and Output formats within the Form Properties window: 2. Select the Template tab on the form and using the Image tool, insert images from a local file or a remote URL.

Images can also be pasted into the form and encoded as base64.

3. Once the image is inserted into the template, open Sheet Options and click the Combining tab to embed the data into the JobInfo MailBodyHTML. 4. Click the Sheet Embedding tab, select the JobInfo radio button and ensure MailBodyHTML is selected on the dropdown menu 5. Click Apply and then OK.


Below is a script example applied on an Enter Modifier on a Mail Output module:

var x= "html><body> <h1>Email Test</h1> <img src=""/> </body></html>" setJobInfo("MailBodyHTML",x)

The email produced from using the above script:

Helpful Unhelpful

Add a comment

Please log in or register to submit a comment.

Need a password reminder?