How to embed an image to an email?
search cancel

How to embed an image to an email?


Article ID: 172412


Updated On:


Workflow Solution ServiceDesk


How to embed an image to an email in a Workflow project?


This is not as easy a question as it sounds. There is no single built-in component for adding image to HTML, especially encoding it. However, logic can be built to do exactly that.

  1. Make sure you have the image as a byte array, FileDataType works and is a logical choice. 'Initialize Data' is a component that can be used to bring that in.
  2. Use 'Encode to Base64' component to encode the image data - FileDataType.Contents is the byte array.
  3. Put together HTML for the embedded image, 'Merge Text' is probably the best component for this: <IMG alt="My Image" src="data:image/jpeg;base64,[Encode to Base64 output variable]">
  4. Resulting HTML that be fed into 'Send Email' component as the email body.

Note that whether and how embedded images work may vary based on mail servers and clients.