SendEmail errors

Hi!

Just modified a previously functionnal PAC project chart to accommodate for an SMTP server change. I’m now using an outlook.com email account and am getting error responses from the mail server.

The server settings and login credentials have been verified using both the Outlook.com webmail and via a simple Node-RED test. When I enter the same username, password, server address, port and TLS handshake method which worked with NodeRed I get an -2104 SSL:handshake failed due to invalid or unverifiable certificate. If however I use NONE as the handshake method I then get a -451 SMTP: Login failed. Check username and password.

I believe outook.com in fact uses STARTTLS but NodeRED could send emails fine when I used it with TLS checked and Use secure connection unchecked.

I recall having similar problems a few years back when Google changed its root certificate and I had to upload a new certificate to the controller to match. Has there been a similar change on Outlook’s side? I tried removing the certificate I had added when using the gmail server but I still get the -2104 error.

Any alternative recommended smtp servers which are known to work well?

Using a SNAP-PAC-R1 with firmware 10.4c and PAC Control Basic v10.2D

Thanks!

Any chance you can go back to using gmail? I think the checks that outlook does is the problem.
Also, have you seen this video?

Hi Beno,

Yes I did that exact test right after posting my message yesterday and I couldn’t get any emails out using gmail either but I could still send some using NodeRED.

I’ll have a look at the video.

Thanks,

Just to be clear, I am not suggesting using Node-RED, but simply to ensure your gmail account is set up for the right application specific password which you use in your PAC Control strategy.

1 Like

I get into particular situations where gmail (and others) simply won’t work for me, especially given some time constraints. One service I am using when I get tired of fighting is HostMonster.
www.hostmonster.com
You have lots of control over the settings. I have an account I use for demonstrations that has the security setting similar to about 10 years ago (ie. not very secure) It does not change and always works with Pac Control.
They provide a full suite of tools, but I just use it for the email, and only for Pac Control or groovView. It is relatively cheap.

1 Like

So I’m back after enabling 2FA in a separate Google account and creating an app password. I confirmed that the new password works in Node-RED with both ports 587 and 465 with TLS checked.

Here is what I get in PAC control with the SendEmail command when debugging my chart with either the GlobalSignRootCA-R2.crt or the GSR2.crt certificates installed:

Using smtp.gmail.com as server with port 587 and tls I get a -2104 error
Using smtp.gmail.com as server with port 587 and ssl I get a -2104 error
Using smtp.gmail.com as server with port 587 and none I get a -451 error
Using smtp.gmail.com as server with port 465 and ssl I get a -443 error after a long wait.
Using smtp.gmail.com as server with port 465 and tls I get a -443 error after a long wait.

This is what the offending line of code looks like but I’m using it in a few other places across different charts in the project:
I_Status = SendEmail(EMAIL_Server_str_arr,EMAIL_Recipient_str_arr,EMAIL_Body_str_arr);

EMAIL_Server_str_arr looks like this:
server

EMAIL_Recipient_str_arr looks like this (that email address is from a different account btw):
recipient

EMAIL_Body_str_arr looks like this:

Both the Raspberry Pi running Node-RED and the R1 are on the same network and use the same outgoing connection.

Thanks for your support!

Hi Beno,

Any more insights into what might be happening? I can’t seem to be able to get any emails out regardless of the SMTP server I use.

Thanks!