# Unexpected socket close error

**URL:** <https://discourse.nodered.org/t/unexpected-socket-close-error/67107>\
**Category:** General\
**Created:** [30 August 2022 07:24 UTC](https://discourse.nodered.org/t/unexpected-socket-close-error/67107 "2022-08-30T07:24:30Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![DionCosina](https://avatars.discourse-cdn.com/v4/letter/d/da6949/32.png) [@DionCosina](https://discourse.nodered.org/u/DionCosina)\
**Post date:** [30 August 2022 07:24 UTC](https://discourse.nodered.org/t/unexpected-socket-close-error/67107/1 "2022-08-30T07:24:30Z")

</div>

I want to send an email with gmail but when its sending i get a error unexpected socket close. How to fix this?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [30 August 2022 07:44 UTC](https://discourse.nodered.org/t/unexpected-socket-close-error/67107/2 "2022-08-30T07:44:38Z")

</div>

Are you using a google [application password](https://support.google.com/accounts/answer/185833?hl=en) or just the account password?

What version of node-red, node-js are you using?

Which email node are you using (provide a link to it in the flows library)?

Where is node-red installed (docker? HA plugin, on a PI, etc)?

---

<div class="post-metadata">

**Author:** ![DionCosina](https://avatars.discourse-cdn.com/v4/letter/d/da6949/32.png) [@DionCosina](https://discourse.nodered.org/u/DionCosina)\
**Post date:** [30 August 2022 07:55 UTC](https://discourse.nodered.org/t/unexpected-socket-close-error/67107/3 "2022-08-30T07:55:10Z")

</div>

I am using application password now  
I am using 16.17.0 for node-js and for node-red i have no idea  
The other 2 questions i dont understand sorry

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [30 August 2022 07:58 UTC](https://discourse.nodered.org/t/unexpected-socket-close-error/67107/4 "2022-08-30T07:58:33Z")

</div>

> [@DionCosina](#):
>
> The other 2 questions i dont understand sorry

> [@Steve-Mcl](#):
>
> Which email node are you using (provide a link to it in the flows library)?

Show us which email mode you have installed and are using

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

> [@Steve-Mcl](#):
>
> Where is node-red installed (docker? HA plugin, on a PI, etc)?

How did you install node-red?

---

<div class="post-metadata">

**Author:** ![DionCosina](https://avatars.discourse-cdn.com/v4/letter/d/da6949/32.png) [@DionCosina](https://discourse.nodered.org/u/DionCosina)\
**Post date:** [30 August 2022 08:03 UTC](https://discourse.nodered.org/t/unexpected-socket-close-error/67107/5 "2022-08-30T08:03:10Z")

</div>

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

I installed node-red with a line of code in my cmd

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [30 August 2022 08:07 UTC](https://discourse.nodered.org/t/unexpected-socket-close-error/67107/6 "2022-08-30T08:07:00Z")

</div>

ok, so I see you are using good versions of everything.

More questions...

1. Does the computer where node-red is installed have internet access?
2. Can you show us a screen shot of the email node, the `msg` you send to it (debug panel screenshot) and the exact error (screenshot of error you see)?
3. Can you share a demo flow (To share a flow, select nodes, right click, export, copy to clipboard, paste into reply)

---

<div class="post-metadata">

**Author:** ![DionCosina](https://avatars.discourse-cdn.com/v4/letter/d/da6949/32.png) [@DionCosina](https://discourse.nodered.org/u/DionCosina)\
**Post date:** [30 August 2022 08:09 UTC](https://discourse.nodered.org/t/unexpected-socket-close-error/67107/7 "2022-08-30T08:09:23Z")

</div>

I fixed it, im sorry for wasting youre time. Thank you for helping.

---

<div class="post-metadata">

**Author:** ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)\
**Post date:** [31 August 2022 19:21 UTC](https://discourse.nodered.org/t/unexpected-socket-close-error/67107/8 "2022-08-31T19:21:08Z")

</div>

It could be helpful to others in the future, if you post your solution here ?

---

<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:** [30 October 2022 19:21 UTC](https://discourse.nodered.org/t/unexpected-socket-close-error/67107/9 "2022-10-30T19:21:21Z")

</div>

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