# Send a mail using Node RED

**URL:** <https://discourse.nodered.org/t/send-a-mail-using-node-red/11368>\
**Category:** General\
**Created:** [21 May 2019 14:09 UTC](https://discourse.nodered.org/t/send-a-mail-using-node-red/11368 "2019-05-21T14:09:35Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![VictorKobayashi](https://avatars.discourse-cdn.com/v4/letter/v/53a042/32.png) [@VictorKobayashi](https://discourse.nodered.org/u/VictorKobayashi)\
**Post date:** [21 May 2019 14:09 UTC](https://discourse.nodered.org/t/send-a-mail-using-node-red/11368/1 "2019-05-21T14:09:35Z")

</div>

Hello,

I'm trying to send a mail using Node-RED but I always have the error "Erreur: fermeture inattendue du socket". Someone can help me please ?

Thanks

---

<div class="post-metadata">

**Author:** ![dustinw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dustinw/32/3426_2.png) [@dustinw](https://discourse.nodered.org/u/dustinw)\
**Post date:** [21 May 2019 16:29 UTC](https://discourse.nodered.org/t/send-a-mail-using-node-red/11368/2 "2019-05-21T16:29:38Z")

</div>

Hi @VictorKobayashi,

The unexpected socket closure means there's some sort of network configuration issue between Node-Red and whatever is sending the mail ... probably a Firewall rule or something like that, but it could also be the mail provider rejecting an unexpected config or bad TLS connection.

For anymore help than that we would need to know: what node you are using to send the mail and what mail service you are using.

---

<div class="post-metadata">

**Author:** ![VictorKobayashi](https://avatars.discourse-cdn.com/v4/letter/v/53a042/32.png) [@VictorKobayashi](https://discourse.nodered.org/u/VictorKobayashi)\
**Post date:** [22 May 2019 14:27 UTC](https://discourse.nodered.org/t/send-a-mail-using-node-red/11368/3 "2019-05-22T14:27:45Z")

</div>

Hello !

To send a mail I using this schema.!

Thanks.

node|539x227

---

<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:** [22 May 2019 14:32 UTC](https://discourse.nodered.org/t/send-a-mail-using-node-red/11368/4 "2019-05-22T14:32:04Z")

</div>

Victor, you did not include your flow. The link does nothing.

---

<div class="post-metadata">

**Author:** ![VictorKobayashi](https://avatars.discourse-cdn.com/v4/letter/v/53a042/32.png) [@VictorKobayashi](https://discourse.nodered.org/u/VictorKobayashi)\
**Post date:** [22 May 2019 14:34 UTC](https://discourse.nodered.org/t/send-a-mail-using-node-red/11368/5 "2019-05-22T14:34:49Z")

</div>

I'm sorry.

[{"id":"659a903.878ce7","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"8318e95e.576d98","type":"e-mail","z":"659a903.878ce7","server":"[smtp.gmail.com](http://smtp.gmail.com)","port":"465 ","secure":false,"tls":true,"name":"victor-kobayashi@hotmail.com","dname":"","x":690,"y":300,"wires":},{"id":"9a19583f.169c68","type":"inject","z":"659a903.878ce7","name":"","topic":"","payload":"Hello World","payloadType":"str","repeat":"30","crontab":"","once":true,"onceDelay":0.1,"x":390,"y":300,"wires":[["8318e95e.576d98","f8a3e2e.077d92"]]},{"id":"f8a3e2e.077d92","type":"debug","z":"659a903.878ce7","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":630,"y":240,"wires":}]

---

<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:** [22 May 2019 16:26 UTC](https://discourse.nodered.org/t/send-a-mail-using-node-red/11368/6 "2019-05-22T16:26:47Z")

</div>

Go read this thread: [How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506/3)  
then edit your last post

---

<div class="post-metadata">

**Author:** ![VictorKobayashi](https://avatars.discourse-cdn.com/v4/letter/v/53a042/32.png) [@VictorKobayashi](https://discourse.nodered.org/u/VictorKobayashi)\
**Post date:** [24 May 2019 15:20 UTC](https://discourse.nodered.org/t/send-a-mail-using-node-red/11368/8 "2019-05-24T15:20:40Z")

</div>

```auto
[{"id":"659a903.878ce7","type":"tab","label":"Flow 2","disabled":true,"info":""},{"id":"8318e95e.576d98","type":"e-mail","z":"659a903.878ce7","server":"smtp.gmail.com","port":"465 ","secure":false,"tls":true,"name":"victor-kobayashi@hotmail.com","dname":"","x":690,"y":300,"wires":[]},{"id":"9a19583f.169c68","type":"inject","z":"659a903.878ce7","name":"","topic":"","payload":"Hello World","payloadType":"str","repeat":"30","crontab":"","once":true,"onceDelay":0.1,"x":390,"y":300,"wires":[["8318e95e.576d98","f8a3e2e.077d92"]]},{"id":"f8a3e2e.077d92","type":"debug","z":"659a903.878ce7","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":630,"y":240,"wires":[]}]

```

---

<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:** [24 May 2019 23:02 UTC](https://discourse.nodered.org/t/send-a-mail-using-node-red/11368/9 "2019-05-24T23:02:56Z")

</div>

Ahh you arte trying to send via gmail. have you done a forum search of 'gmail'?

---

<div class="post-metadata">

**Author:** ![dustinw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dustinw/32/3426_2.png) [@dustinw](https://discourse.nodered.org/u/dustinw)\
**Post date:** [29 May 2019 16:33 UTC](https://discourse.nodered.org/t/send-a-mail-using-node-red/11368/10 "2019-05-29T16:33:00Z")

</div>

As a note, I don't think Gmail will allow you to connect with a non-Gmail address.

You might have a Google account with your Hotmail address, but Google will not allow you to send from a non-google domain (or at least a domain that is configured with Google).
