Embed image(png or jpeg) in email as body or background, not as attachment

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

Embed image(png or jpeg) in email as body or background, not as attachment

Hi. 

 

I have a dashboard saved in unix server as jpeg/png. Trying to send it to folks in email not as attachment. I have tried couple different ways, 

1. put image in proc report as style - it didn't transfer to email

2. ods html text ods html text='<img src="/xxx/images/xxx.jpg"></img>';

 

None of them worked well. Please help me getting this work out. 

 

Thanks!!

 


Accepted Solutions
Solution
‎03-27-2018 01:30 PM
Contributor
Posts: 53

Re: Embed image(png or jpeg) in email as body or background, not as attachment

The best approach would be to move your png over to the content server and reference it there, but if that's not an option - there's the base64 fallback.

 

The 'trick' is to know that image files (such as a png) can be converted and read into your <img> tag as text - as explained in this communities post, the syntax is like:

 

<img src="data&colon;image/png;base64,R0lGODlhEAAQAKL/AP//////
AMDAwMDAwICAgICA\AAAAAAAAACH5BAEAAAIALAAAAAAQAB
AAAANFKEpMpjAKAkYYTkJqu2sbII6kSCzApXbqM1VrPLiUWpYGFwB
F7/+51ID3KwaHReNrlwS+iM0CTRTtTavSjWHL7W41YE0CADs=">

 

But how do you get your dashboard converted to base64 encoding?  Thankfully Michael Dixon has a SAS script that will do just that, check out this post.

 

Hopefully this will get you on your way.

 

/Allan
Think you know SAS? Take the sasensei challenge..

View solution in original post


All Replies
Solution
‎03-27-2018 01:30 PM
Contributor
Posts: 53

Re: Embed image(png or jpeg) in email as body or background, not as attachment

The best approach would be to move your png over to the content server and reference it there, but if that's not an option - there's the base64 fallback.

 

The 'trick' is to know that image files (such as a png) can be converted and read into your <img> tag as text - as explained in this communities post, the syntax is like:

 

<img src="data&colon;image/png;base64,R0lGODlhEAAQAKL/AP//////
AMDAwMDAwICAgICA\AAAAAAAAACH5BAEAAAIALAAAAAAQAB
AAAANFKEpMpjAKAkYYTkJqu2sbII6kSCzApXbqM1VrPLiUWpYGFwB
F7/+51ID3KwaHReNrlwS+iM0CTRTtTavSjWHL7W41YE0CADs=">

 

But how do you get your dashboard converted to base64 encoding?  Thankfully Michael Dixon has a SAS script that will do just that, check out this post.

 

Hopefully this will get you on your way.

 

/Allan
Think you know SAS? Take the sasensei challenge..
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 322 views
  • 1 like
  • 2 in conversation