Hi!
I want to get a picture (jpeg) from a security camera and put it into an email with node red. I realized that with pushover in node red. Sending email also works fine. But I have no idea how to include an jpeg into the email i send with node red (no attachment, it should be included into the mail).
Thanks a lot for your help!
Welcome to the forums @sammie76-2
I dont use the email Node.
But assuming this is a HTML Body?
You could use an inline blob?
<img src="data:image/jpeg;base64,<Base64>"/>
- convert the image to base 64
- In a
Template
Node, use something like below
<img src="data:image/jpeg;base64,{{{msg.imageB64}}}"/>
See: How to display Base64 images in HTML - Stack Overflow
Most emails clients also support including the image in body (that is attached) - but I think its more work.
Others may have tricks here (or correct ways
), but its what first popped into my head.
you can convert the buffer of an image to base64 in Node RED very easily.
I include images this way often in other systems
If you use the email node:
If the payload is a binary buffer then it will be converted to an attachment. The filename should be set using msg.filename
. Optionally msg.description
can be added for the body text.