Skip to main content

Hi,

 

How to embed an image when sending email using k2 five?

I found a different way to send an email with an image embedded on it

tried but failed using v4.7

 

I tried below code to send but failed. As base64 image, it works on outlook but not on gmail. And some recipients too complained to there is no logo.

 

<table><tr><td><img src="data&colon;image/jpg;base64,Data Label Logo Header"/></td></tr></table>

 

Thanks

Hi Dabuskol,

 

To embed an image, add the image to the email as an attachment and
use an image tag to reference the image where you want to see it “<img src="imagename.jpg" alt="image description">”.

 

Alternatively, have a look at the Exchange Mailbox Service Broker which allows you to add inline attachments to your email body before sending.

 

Another recommendation: 
https://community.k2.com/t5/K2-Blackpearl-Forum-Posts/How-To-Embed-Image-in-Email/m-p/71766#M20601

 

Regards,

Sello


Hi,

My objective:

1. to be able to change the sender (from) depending on the department.

2. Logos department must appear on the email.

 

Note:

- Base64 is working in k2 but if you are using a lower version of outlook and gmail, image will not appear.

- send email using workflow with image is perfectly working too.

 -cid: with inline which is another format, the one I used has the same behavior but with lesser bytes on the email itself and images is not blocked on gmail.

 

Since I am using an Exchange email. I created a c# web service that sends email with 3 parameters (From, To, MessageBody). Then export it to K2 using endpoints to be used as SMO.

 

  CreateAttachmentType attachmentRequest = new CreateAttachmentType();
attachmentRequest.Attachments = new AttachmentTypet1];
attachmentRequest.Attachmentsm0] = fileAttach;
attachmentRequest.Attachmentsm0].IsInline = true;
attachmentRequest.Attachmentsm0].ContentId = FileName;
attachmentRequest.ParentItemId = emailResponseMessage.Items.ItemsI0].ItemId;

 

IsInline and contentid will retain the image in email body

 

so far it is working with our users.

 

base64 is reading from database with stored logo

cid is reading from specific directory from the server.

 

Hope it help, the least an idea.

 

Regards

 

 

 

 

 


Reply