# Email notification for triggering flow

**URL:** <https://discourse.nodered.org/t/email-notification-for-triggering-flow/77787>\
**Category:** General\
**Tags:** function-node\
**Created:** [21 April 2023 11:14 UTC](https://discourse.nodered.org/t/email-notification-for-triggering-flow/77787 "2023-04-21T11:14:14Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![nit-cyber](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nit-cyber/32/72630_2.png) [@nit-cyber](https://discourse.nodered.org/u/nit-cyber)\
**Post date:** [21 April 2023 11:14 UTC](https://discourse.nodered.org/t/email-notification-for-triggering-flow/77787/1 "2023-04-21T11:14:14Z")

</div>

email notification for triggering flow

---

<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:** [21 April 2023 11:22 UTC](https://discourse.nodered.org/t/email-notification-for-triggering-flow/77787/2 "2023-04-21T11:22:39Z")

</div>

Ok, what do you mean? Did you mean to show us how and forgot to include more information or are you having a problem?

If you are having a problem, show us what you have tried.

---

<div class="post-metadata">

**Author:** ![nit-cyber](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nit-cyber/32/72630_2.png) [@nit-cyber](https://discourse.nodered.org/u/nit-cyber)\
**Post date:** [21 April 2023 12:00 UTC](https://discourse.nodered.org/t/email-notification-for-triggering-flow/77787/3 "2023-04-21T12:00:43Z")

</div>

I am entering userid and password than also not sending mail and showing error  
Error: Unexpected socket close  
Error: Invalid login: 535-5.7.8 Username and Password not accepted. Learn more at  
535 5.7.8 [Check Gmail through other email platforms - Gmail Help](https://support.google.com/mail/?p=BadCredentials) o9-20020a629a09000000b0062d90f36d16sm2873349pfe.88 - gsmtp

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

---

<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:** [21 April 2023 12:22 UTC](https://discourse.nodered.org/t/email-notification-for-triggering-flow/77787/4 "2023-04-21T12:22:34Z")

</div>

So did you check to see what that message means?  
Did you search the forum? (try using `gmail` and see what you find.)

---

<div class="post-metadata">

**Author:** ![nit-cyber](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nit-cyber/32/72630_2.png) [@nit-cyber](https://discourse.nodered.org/u/nit-cyber)\
**Post date:** [21 April 2023 12:29 UTC](https://discourse.nodered.org/t/email-notification-for-triggering-flow/77787/5 "2023-04-21T12:29:53Z")

</div>

yes i tried i am not able to send messages and receive by entering right credentials

---

<div class="post-metadata">

**Author:** ![mudwalker](https://avatars.discourse-cdn.com/v4/letter/m/47e85d/32.png) [@mudwalker](https://discourse.nodered.org/u/mudwalker)\
**Post date:** [21 April 2023 12:36 UTC](https://discourse.nodered.org/t/email-notification-for-triggering-flow/77787/6 "2023-04-21T12:36:40Z")

</div>

> [@zenofmud](#):
>
> So did you check o see what that message means?  
> Did you search the forum? (try using `gmail` and see what you find.)

Have you tried @zenofmud suggestion of searching the forum?

---

<div class="post-metadata">

**Author:** ![nit-cyber](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nit-cyber/32/72630_2.png) [@nit-cyber](https://discourse.nodered.org/u/nit-cyber)\
**Post date:** [21 April 2023 12:57 UTC](https://discourse.nodered.org/t/email-notification-for-triggering-flow/77787/7 "2023-04-21T12:57:57Z")

</div>

please provide example flow

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [21 April 2023 13:31 UTC](https://discourse.nodered.org/t/email-notification-for-triggering-flow/77787/8 "2023-04-21T13:31:59Z")

</div>

![Untitled 1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/7/d7dcdc04dff601dc2867a4f119078c439b3c9a15.jpeg)

```auto
[
    {
        "id": "22cfdecd0e82aeb6",
        "type": "tab",
        "label": "Flow 3",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "9761767aebdb6f60",
        "type": "inject",
        "z": "22cfdecd0e82aeb6",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 160,
        "y": 100,
        "wires": [
            [
                "727778b00c424088"
            ]
        ]
    },
    {
        "id": "9d13b207848dcc58",
        "type": "e-mail",
        "z": "22cfdecd0e82aeb6",
        "server": "smtp.gmail.com",
        "port": "465",
        "authtype": "BASIC",
        "saslformat": true,
        "token": "oauth2Response.access_token",
        "secure": true,
        "tls": true,
        "name": "",
        "dname": "",
        "credentials": {
            "userid": "blahblah@gmail.com"
        },
        "x": 530,
        "y": 100,
        "wires": []
    },
    {
        "id": "23e0ac9f4692855c",
        "type": "e-mail in",
        "z": "22cfdecd0e82aeb6",
        "name": "",
        "protocol": "IMAP",
        "server": "imap.gmail.com",
        "useSSL": true,
        "autotls": "never",
        "port": "993",
        "authtype": "BASIC",
        "saslformat": true,
        "token": "oauth2Response.access_token",
        "box": "INBOX",
        "disposition": "Read",
        "criteria": "UNSEEN",
        "repeat": "300",
        "fetch": "trigger",
        "inputs": 1,
        "credentials": {
            "userid": "blahblahi@gmail.com"
        },
        "x": 330,
        "y": 160,
        "wires": [
            [
                "8d83d2ce0f890274"
            ]
        ]
    },
    {
        "id": "8d83d2ce0f890274",
        "type": "debug",
        "z": "22cfdecd0e82aeb6",
        "name": "debug 294",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 490,
        "y": 160,
        "wires": []
    },
    {
        "id": "727778b00c424088",
        "type": "function",
        "z": "22cfdecd0e82aeb6",
        "name": "function 27",
        "func": "msg.payload = \"This is a test email\" ; \nmsg.topic = \"Testing Node-RED send email\";\nmsg.to = \"blahblah@gmail.com\";\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 350,
        "y": 100,
        "wires": [
            [
                "9d13b207848dcc58"
            ]
        ]
    },
    {
        "id": "af029c349211cce5",
        "type": "inject",
        "z": "22cfdecd0e82aeb6",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 160,
        "y": 160,
        "wires": [
            [
                "23e0ac9f4692855c"
            ]
        ]
    }
]

```

You may find that this does not work for you.  
If so, I recommend searching the forum for "gmail" and reading the first 5 - 10 discussions, there's sure to be a clue there.

---

<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:** [21 April 2023 14:00 UTC](https://discourse.nodered.org/t/email-notification-for-triggering-flow/77787/9 "2023-04-21T14:00:33Z")

</div>

And show us your flow so we can see what you have tried so far.

In order to make code readable and usable it is necessary to surround your code with three backticks (also known as a left quote or backquote `````)

````auto
``` 
   code goes here 
```

````

You can edit and correct your post by clicking the pencil ✏ icon.

See this post for more details - [How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506)

---

<div class="post-metadata">

**Author:** ![nit-cyber](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nit-cyber/32/72630_2.png) [@nit-cyber](https://discourse.nodered.org/u/nit-cyber)\
**Post date:** [3 May 2023 08:18 UTC](https://discourse.nodered.org/t/email-notification-for-triggering-flow/77787/10 "2023-05-03T08:18:37Z")

</div>

done thanks

---

<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:** [2 July 2023 08:19 UTC](https://discourse.nodered.org/t/email-notification-for-triggering-flow/77787/11 "2023-07-02T08:19:05Z")

</div>

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