I don't arrive to send an email with node email

Do NOT try to run the upgrade script on this device - It will probably make things worse...
What exact hardware are you running on ?

1 Like

Oops! dceejay knows what he's talking about, I'm just a beginner!

I assumed nke9 was using a Raspberry Pi, but in fact it's nyghtrider who's screenshot shows /home/pi/.node-red.

The version installed of the email is 0.1.29.

No problem thanks for your help !

It's a LoRa gateway where a specific linux is installed.

How interesting. I am also battling with an embedded linux/node-red system. The Pi is my test bench. To get the embedded system to accept new nodes I had to upgrade the firmware from the manufacturer. They had released a new firmware with v1.3.5 included and that helped. Maybe that's not an option for you although LoRa gear is still current. If you install a new firmware it should reset the layout and possibly return the access to the Palette Manager. Even installing the same firmware will do this. Can you reset the device? The firmware update for these devices is more than a little tricky so get some help from the manufacturer or their forum.

OH ! It's seems to be not easy to use Node-RED on embedded system, thanks for your message. I had reset the device and have the Palette manager back. I have tried send an email but I've always the same error message. May be the gateway block some ports but i'm going to see with the manufacturer if they have solution because I have no more idea to fix this problem.

I agree that the App Password works better than reducing the security level (Google will keep pestering you about the reduced security). I also have a separate gmail account for my Node-Red device, which only sends e-mails to my main account. I like the separation of human vs. automatic.

1 Like

I've made all what you did ... reducing the security level et create a separate gmail accoun just for this application but anything change.

I suspect that the old version of NR and the old version of the email node don't work with the new requirements of Gmail. You could try sending email via a different email provider and se if that would work.

I have found that Google occasionally turn off the less secure apps flag on gmail accounts resulting in email notifications not being sent.

A better way seems to be:
Use a gmail account specially created for Node-Red rather than your main gmail account..
Turn on two factor authentication for the account.
Create an app password.
In the email node: Server smtp.gmail.com, Port 465, Use secure connection, Userid myraspberrypi@gmail.com, Password the 16 character app password generated above.

Of course if it's a problem with old versions of NR or the email node, it still won't work.

1 Like

I try this methos also and it doesn't work ...
I've tried to update the node email and i've an error message : module not locally installed

May be I will try to update the node email by prompt command

I try to update le node email and when i went in the package.json the version is the last but not on node-red software.

Iā€™m not quite sure what you are saying. Can you expand your explanation?
What did you actual do to try and update?

Also, have you searched thru the forum and read the other node-red-node-email threads? You might find something useful in one of them.

I'have delete the email node and reinstall it with the npm command.

Yes I've searched in other discussions group but I've found nothing that can help me

Can you send mail from Python?
This script works for me:

#! /usr/bin/python3
import smtplib

username='account@gmail.com'
password='16CharAppPassword'
sendto='recipient@gmail.com'
replyto=username

subject='Test gmail from python' 
content="Hello, this is a gmail test.\nRegards, Raspberry"

# start talking to the SMTP server for Gmail
s = smtplib.SMTP('smtp.gmail.com', 587)
s.starttls()
s.ehlo()
# now login as gmail user
s.login(username,password)
# the email objects
# compose the email. probably should use the email python module
mailtext='From: '+replyto+'\nTo: '+sendto+'\n'
mailtext=mailtext+'Subject:'+subject+'\n'+content
# send the email
s.sendmail(replyto, sendto, mailtext)
# we're done
rslt=s.quit()
# print the result
print('Sendmail result=' + str(rslt[1]))

Thanks for your help but when I run the script I have this error message : socket.errir [Errno 101] Network is unreachable

I have found why I couldn't send an email from Node-RED the firewall of my device was blocking the port 465 for the smtp.
So in the /etc/firewall.d/00_default.rules file I need to add the folowing line before the COMMIT of this file :

# SMTP
-A OUTPUT -p tcp --dport 465 -j ACCEPT
-A INPUT  -p tcp --sport 465 -j ACCEPT

and after that, restart the firewall with this folowing command : /etc/init.d/firewall restart

And now all is working thanks you all for your help !

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.