PDF Make Node, Issues creating an E-mail with text

Hey everyone,

I'm Michael from Germany, and I'm pretty new to Node-RED. I recently built a machine for vacuum testing and now want to create a protocol for the testing process.

The protocol should include information like:

  • Which functions were activated during the test,
  • Who performed the test,
  • Which part was tested, and so on.

The idea is to send this protocol via email to a specific address. Ideally, the flow would generate a PDF document with all the collected values and the company’s logo.

Right now, I’m having an issue with sending the email, and I think it might be because of the format of the values. I’m also not sure how to properly use the pdfmake node.

I’ve attached my flow and would really appreciate it if someone could help me out or share some tips on how to make this work. Thanks a lot in advance!

Cheers,
Michael

I don't think I've ever actually bothered to send an email from Node-RED myself so not totally sure I can help with that - though I'm sure we could work it out.

However, a question. Why a PDF? Those are a pain to work with and generally are not accessible which might be an issue for you given EU laws in that area.

Instead, why not simply make use of HTML in the email?

For your logo, I recommend running through an online tool to fully optimise it and then run it through a tool to turn it into a data url. That will let you embed it into an HTML email and have the email client's more reliably display it.

All modern email clients will accept HTML emails and will deal with basic formatting. Just avoid JavaScript, external fonts and overly complex CSS.

Sorry - i forgot the attachment

@TotallyInformation : Hey, thanks for the tip! Yes, implementing it with HTML could also be an option. As I mentioned, I’m new to this topic and don’t know much yet. At the moment, it’s not working at all, and I’m getting an error message.

I believe my email setup is configured correctly. I’m using ioBroker, and in the email settings, there’s an option to send a test email. That works fine. I think the issue is with the setup in Node-RED. That’s probably where things aren’t working as they should.

So it doesn't think that your mailbox address is correct. Is it entered correctly?

yes i think so :


this are my settings in ioBroker. and here in NodeRed:

this message is in the debug node :

Check you have the right port number.

According to https://hilfe.web.de/pop-imap/imap/imap-serverdaten.html the SMTP port is 587

Darn it, you beat me to it! :smile:

The error persists even after changing the port



but web.de says that port 465 is also ok

In that case, the auth type is also probably wrong. I'm afraid I can't remember what the options are.

I suspect you need someone with a web.de email account to share experience their :anguished:

which email client would you recommend for general use? i´m open to suggestions like Gmail or others...

I do use gmail, there's a howto somewhere on the forum. here:
https://discourse.nodered.org/t/gmail-email-in-node-no-longer-working-with-username-password/60683/5
Also see
https://flowfuse.com/node-red/notification/email/

I have not tested with attachments though.

GMail, Outlook, etc all use Modern Authentication methods which generally means that you need to create an application code for logging in from a system.

For those, you may have to use the OAuth2 option but you will need a suitable token from the service.


For what I can see, web.de requires the part BEFORE the @ symbol as your user id and it should accept the basic login.

Okay, I’ll try this with Gmail tonight. @jbudd, thanks for the link!

I’m wondering if the issue is related to the email node itself, or if I made a mistake earlier in the flow. I’ve collected multiple values and combined them using a join node.

Do I need a function node as well to format the data, or can I connect the output of the join node directly to the email node?

Did you try using just the name before the @ symbol as the id?

yes i tried this with 465 and with 587.


and i changed the name to vacucheck (without the @symbol an web.de)
but it doesn´t work. the Test function in iobroker works with nr 465)
but here in Node red : It still doesn't work

OK, seems like others have had issues with that service as well. Gmail it is then by the looks of it!

Hey, I’m very happy to say that it’s now working with Gmail. I’m really, really happy—thank you so much for your help!

I want to create a test protocol that collects all the data in my flow. I already have a script in my function node, but unfortunately, it’s not working. It was created with ChatGPT. Maybe someone can check it to see what the problem is?
Thats the code :


Thats the flow:

and that ist the output in the Mail:

the nodes with the description "Statusauswertung" translates the values to an readable format. Example: