I'm playing around with trying to get node-red to send me an email through my exchange server. I do this all the time with other applications. Ive tried the mail node on here but it isn't letting me inject the email. I get error connection refused errors. I just want to see if I can do it on node-red. my overall goal is everyday to poll open weather and get the temp then send myself an email with it.
Not really. As I said, almost certainly down to what authentication types the node supports. At least we now know that you do have the rights to do a send, that is no longer a given in many organisations.
I assume you used mailsend rather than Outlook when sending from PowerShell.
What platform are you running Node-RED on? Windows or Linux?
A workaround would be to use the exec node and a PowerShell script.
Thanks for sharing. But that is for cloud-based Exchange Online - and only works if you don't have MFA turned on unless you then register and use an application password. The OP was about an on-prem server I believe.
Yeah it's on-prem... So far I can send emails now via kicking off powershell and sending it that way. I have been playing around more with the settings of node-red-node-email and I'm not getting authentication errors so at least its now hitting the server. I'm thinking it's looking for a 'from' maybe?
It's weird I'm looking at the logs but nothing was there... So we have always been able to inject emails from other apps in there and they don't need a username or password. so this is what I did, I removed username and password and it started getting 'external' emails, I'm not sure why this didn't work last week when i tried it but who knows. After that I edited, 61-email.js and after line 98 I added:
sendopt.from = "username@mydomain.com"
That stopped the 'external' email alert. I need to see if there is more I can do with this....
So, that isn't a configuration I would allow in our organisation. Emails should always be tracable and it generally isn't a good idea to allow any old application to send them without authentication so we would require at least a service account to be defined for each application that sends emails. Probably with a non-expiring password.