Skip to main content
Solved

Email body with image


Forum|alt.badge.img+13

Hi,

 

I want to dynamically add images to the email body which will be sent bij dbmail.
Because of more departments en several marks the logo’s added to the email body need to be added dynamically base on user en department.
If now added a table with a link to the path, that works fine in the application but when sending it out the logo’s are empty, because of the pointer to the local path.
For one html table cell for example <td><img src="G:\Thinkwise\logo1.png” 

I have stored the images in the database as well on department level, let’s say the field [department].logo
I’ve created an email-template with the tekst [handtekening] 
When creating the email I replace the [handtekening] tekst with the complete email signature of the user.

When I put the logo directly in my email template, the logo is embedded in the template and that works, but that is not dynamic.
 

So the challenge is to add the code of the image stored in the [department].logo field (or the code of the image stored on the location “g:\thinkiwsie\logo1.png” into the body field of the email to be sent out.
I store each ‘to-be-sent’ in a email_send_list table and table has a field body (html type)

I hope anyone of you can give me a clue…. 

 

Best answer by Edwin Saan

Hi Erwin, thans. I already found out that I had to convert the images to base64 code. I thought I had posted my own solution but apparently that has failed. I decoded the images with an internet tool to a base64 code and with that code I can dynamically add the images to the body. Case closed

View original
Did this topic help you find an answer to your question?
This topic has been closed for replies.

2 replies

Forum|alt.badge.img+17
  • Moderator
  • 768 replies
  • January 19, 2022

 If the images are stored in the database you could use base64 as the image source. 

Please check this post where Jasper shared an example:

 

 


Forum|alt.badge.img+13
  • Author
  • Sidekick
  • 123 replies
  • Answer
  • January 19, 2022

Hi Erwin, thans. I already found out that I had to convert the images to base64 code. I thought I had posted my own solution but apparently that has failed. I decoded the images with an internet tool to a base64 code and with that code I can dynamically add the images to the body. Case closed


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings