1

The macro scheduler I am using is the product offered at https://www.mjtnet.com/

My ultimate goal is to have a macro that will send emails with images embedded into it. To do this, I want to be able to convert image files into Base64 strings so that they can be embedded with HTML. The problem that I'm running into is that I cannot figure out how to properly access the data for the image files within Macro Scheduler. I've tried using the file location of the image as an input for the Base64 function, but that only returns the encoded version of the location string. I've also tried using the ReadFile function, but that returns an empty string as it's use is for text files.

Currently my program looks like this:

Let>SENDMAIL_STATUS=1
Let>SMTP_HTMLBODY=1
Let>image=C:\Users\xyz\Documents\image.png
Base64>image,ENCODE,embedded
Let>body=<html> <head> </head> <body> <img src="data:image/png;base64,%embedded%"> </body> </html>
SMTPSendMail>...,...,...,...,...,body,image

The email sends without issue, but the body of it only shows an empty image icon.

So with all this in mind, how do I encode an image file into a base64 string?

Rubén
  • 34,714
  • 9
  • 70
  • 166
KKar
  • 11
  • 4

0 Answers0