# Email error "Error: Invalid HELO. response=501 5.5.4 Invalid domain name"

**URL:** <https://discourse.nodered.org/t/email-error-error-invalid-helo-response-501-5-5-4-invalid-domain-name/73334>\
**Category:** General\
**Created:** [7 January 2023 14:51 UTC](https://discourse.nodered.org/t/email-error-error-invalid-helo-response-501-5-5-4-invalid-domain-name/73334 "2023-01-07T14:51:54Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![ianh33](https://avatars.discourse-cdn.com/v4/letter/i/ea5d25/32.png) [@ianh33](https://discourse.nodered.org/u/ianh33)\
**Post date:** [7 January 2023 14:51 UTC](https://discourse.nodered.org/t/email-error-error-invalid-helo-response-501-5-5-4-invalid-domain-name/73334/1 "2023-01-07T14:51:54Z")

</div>

Node red v3.0.2 enabled via PM2 on a Mac Mini running OSX Monterey

I have installed node-red-node-email (v1.18.4). My email node is configured as follows:  
To: [myemail@me.com](mailto:myemail@me.com)  
Server: [smtp.office365.com](http://smtp.office365.com)  
Port: 5887  
Use secure connection: disabled  
Userid: [myemail@me.com](mailto:myemail@me.com)  
Password: abc123  
TLS option: enabled or disabled....same error regardless

Any troubleshooting pointers would be very welcom

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [7 January 2023 21:36 UTC](https://discourse.nodered.org/t/email-error-error-invalid-helo-response-501-5-5-4-invalid-domain-name/73334/2 "2023-01-07T21:36:01Z")

</div>

You sure about `smtp.office360.com`? If I enter `http://smtp.office360.com` in a browser I get a ‘server not found’ msg.

---

<div class="post-metadata">

**Author:** ![ianh33](https://avatars.discourse-cdn.com/v4/letter/i/ea5d25/32.png) [@ianh33](https://discourse.nodered.org/u/ianh33)\
**Post date:** [7 January 2023 21:49 UTC](https://discourse.nodered.org/t/email-error-error-invalid-helo-response-501-5-5-4-invalid-domain-name/73334/3 "2023-01-07T21:49:35Z")

</div>

Thank you for looking at this ....... yes here is an extract of microsoft's website

 ![ms](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/8/184c98083b9e7b3027e5051519411ea47c6d78a5.jpeg)

> **[How to set up a multifunction device or application to send email using...](https://learn.microsoft.com/en-us/exchange/mail-flow-best-practices/how-to-set-up-a-multifunction-device-or-application-to-send-email-using-microsoft-365-or-office-365)**
>
> Learn how to set up printers, scanners, LOB applications to send email using Microsoft 365 or Office 365.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [7 January 2023 21:59 UTC](https://discourse.nodered.org/t/email-error-error-invalid-helo-response-501-5-5-4-invalid-domain-name/73334/4 "2023-01-07T21:59:21Z")

</div>

> [@zenofmud](#):
>
> `smtp.office360.com`

oops, I used 360 instead of 365 😳

When you run the flow, does it fail right away?  
add a `catch` node connected to a `debug` node (set to display the complete msg object) and see if that shows anything,

I'm testing on a Mac mini Ventura

[update] I just ran using the exact credentials you show (yes I know the user iid and password are fake) and get this in return from a `catch` node:  
 ![Screenshot 2023-01-07 at 4.59.46 PM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/6/2643fa084f233b95087207fc29fa21e88f341a1f.png)

Where are you seeing the invalid HELO?

---

<div class="post-metadata">

**Author:** ![ianh33](https://avatars.discourse-cdn.com/v4/letter/i/ea5d25/32.png) [@ianh33](https://discourse.nodered.org/u/ianh33)\
**Post date:** [7 January 2023 22:11 UTC](https://discourse.nodered.org/t/email-error-error-invalid-helo-response-501-5-5-4-invalid-domain-name/73334/5 "2023-01-07T22:11:38Z")

</div>

Thank you.... I will test tomorrow and revert

---

<div class="post-metadata">

**Author:** ![ianh33](https://avatars.discourse-cdn.com/v4/letter/i/ea5d25/32.png) [@ianh33](https://discourse.nodered.org/u/ianh33)\
**Post date:** [8 January 2023 11:04 UTC](https://discourse.nodered.org/t/email-error-error-invalid-helo-response-501-5-5-4-invalid-domain-name/73334/6 "2023-01-08T11:04:12Z")

</div>

It takes about 5 seconds to return an error and this is the error message:

```auto
Error: Invalid HELO. response=501 5.5.4 Invalid domain name [LNXP123CA0019.GBRP123.PROD.OUTLOOK.COM]: 501 5.5.4 Invalid domain name [LNXP123CA0019.GBRP123.PROD.OUTLOOK.COM]
    at SMTPConnection._actionHELO (/Users/auser/.node-red/node_modules/node-red-node-email/node_modules/nodemailer/lib/smtp-connection/index.js:1336:27)
    at SMTPConnection._processResponse (/Users/auser/.node-red/node_modules/node-red-node-email/node_modules/nodemailer/lib/smtp-connection/index.js:953:20)
    at SMTPConnection._onData (/Users/auser/.node-red/node_modules/node-red-node-email/node_modules/nodemailer/lib/smtp-connection/index.js:755:14)
    at Socket.SMTPConnection._onSocketData (/Users/auser/.node-red/node_modules/node-red-node-email/node_modules/nodemailer/lib/smtp-connection/index.js:193:44)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:324:12)
    at readableAddChunk (node:internal/streams/readable:297:9)
    at Socket.Readable.push (node...

```

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [8 January 2023 14:03 UTC](https://discourse.nodered.org/t/email-error-error-invalid-helo-response-501-5-5-4-invalid-domain-name/73334/7 "2023-01-08T14:03:32Z")

</div>

Did you add a catch node like I suggested? What you posted looks like it came from a log

---

<div class="post-metadata">

**Author:** ![ianh33](https://avatars.discourse-cdn.com/v4/letter/i/ea5d25/32.png) [@ianh33](https://discourse.nodered.org/u/ianh33)\
**Post date:** [8 January 2023 14:28 UTC](https://discourse.nodered.org/t/email-error-error-invalid-helo-response-501-5-5-4-invalid-domain-name/73334/8 "2023-01-08T14:28:41Z")

</div>

Thank you. Yes the text I posted is the "stack" section of the debug node connected to a "catch all" node.

Is this OK ? I have not used catch all before

 ![nr](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/9/69b18b5e9cb76437e4aeba4e309fa92f07f9c9af.jpeg)

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [8 January 2023 17:35 UTC](https://discourse.nodered.org/t/email-error-error-invalid-helo-response-501-5-5-4-invalid-domain-name/73334/9 "2023-01-08T17:35:22Z")

</div>

> [@ianh33](#):
>
> Invalid domain name [[LNXP123CA0019.GBRP123.PROD.OUTLOOK.COM](http://LNXP123CA0019.GBRP123.PROD.OUTLOOK.COM)]`

Is that the domain you are trying to use?

---

<div class="post-metadata">

**Author:** ![ianh33](https://avatars.discourse-cdn.com/v4/letter/i/ea5d25/32.png) [@ianh33](https://discourse.nodered.org/u/ianh33)\
**Post date:** [8 January 2023 17:39 UTC](https://discourse.nodered.org/t/email-error-error-invalid-helo-response-501-5-5-4-invalid-domain-name/73334/10 "2023-01-08T17:39:43Z")

</div>

Maybe !!! I guess that's an internal Microsoft reference, but I have my own domain registered with MS.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [8 January 2023 22:43 UTC](https://discourse.nodered.org/t/email-error-error-invalid-helo-response-501-5-5-4-invalid-domain-name/73334/11 "2023-01-08T22:43:54Z")

</div>

That is the domain name that is invalid. This looks like a Microsoft related issue. If you do a google search using `Invalid domain name [LNXP123CA0019.GBRP123.PROD.OUTLOOK.COM]` you'll see some similar issues. You are going to have to read them and try what they say.

Sorry I can't give you more help.

---

<div class="post-metadata">

**Author:** ![ianh33](https://avatars.discourse-cdn.com/v4/letter/i/ea5d25/32.png) [@ianh33](https://discourse.nodered.org/u/ianh33)\
**Post date:** [8 January 2023 22:46 UTC](https://discourse.nodered.org/t/email-error-error-invalid-helo-response-501-5-5-4-invalid-domain-name/73334/12 "2023-01-08T22:46:02Z")

</div>

Thank you for your help. I did do that before I posted here.... i will search harder 🙂 Thank you once again

---

<div class="post-metadata">

**Author:** ![smanjunath211](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/smanjunath211/32/95742_2.png) [@smanjunath211](https://discourse.nodered.org/u/smanjunath211)\
**Post date:** [9 January 2023 06:09 UTC](https://discourse.nodered.org/t/email-error-error-invalid-helo-response-501-5-5-4-invalid-domain-name/73334/13 "2023-01-09T06:09:51Z")

</div>

While my email setup and your may be totally different, may be once you can try with the following settings. This is working for me for many days without any issue.

_pls note: [smtp.office365.com](http://smtp.office365.com) works too._ the only major change i see in your and mine is the port **587** vs **5887** hope it is not just a typo.

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/9/a9122b67131925d2f54340eb4fa87dbd5c392b11.png)

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/1/a12a7717f8beb87e488d848b02251c6e6a7d4c6b.png)

---

<div class="post-metadata">

**Author:** ![ianh33](https://avatars.discourse-cdn.com/v4/letter/i/ea5d25/32.png) [@ianh33](https://discourse.nodered.org/u/ianh33)\
**Post date:** [9 January 2023 06:25 UTC](https://discourse.nodered.org/t/email-error-error-invalid-helo-response-501-5-5-4-invalid-domain-name/73334/14 "2023-01-09T06:25:14Z")

</div>

Yes.... 5887 was a typo. I use 587.

I get the same error message using [smtp-mail.outlook.com](http://smtp-mail.outlook.com).

I think this must be a Microsoft issue as my settings (apart from user name and password) are exactly the same as yours.

Thank you for trying to help, very kind.

---

<div class="post-metadata">

**Author:** ![ianh33](https://avatars.discourse-cdn.com/v4/letter/i/ea5d25/32.png) [@ianh33](https://discourse.nodered.org/u/ianh33)\
**Post date:** [9 January 2023 07:50 UTC](https://discourse.nodered.org/t/email-error-error-invalid-helo-response-501-5-5-4-invalid-domain-name/73334/15 "2023-01-09T07:50:24Z")

</div>

SOLVED

My mac mini had a short name on my network e.g. "abcd.local". For some reason (router, local dns table or the mac) my domain became "httpabcd". I remember seeing (google search for error) that http at the begining of a domain name is an issue for ms email servers. I simply changed my mac's sharing name to abcdefgh.local and flushed my router's arp cache.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [23 January 2023 07:50 UTC](https://discourse.nodered.org/t/email-error-error-invalid-helo-response-501-5-5-4-invalid-domain-name/73334/16 "2023-01-23T07:50:57Z")

</div>

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