# Can't recover mail adresse UI\_FORM

**URL:** <https://discourse.nodered.org/t/cant-recover-mail-adresse-ui-form/44392>\
**Category:** Dashboard\
**Created:** [19 April 2021 09:11 UTC](https://discourse.nodered.org/t/cant-recover-mail-adresse-ui-form/44392 "2021-04-19T09:11:37Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![lyred](https://avatars.discourse-cdn.com/v4/letter/l/ccd318/32.png) [@lyred](https://discourse.nodered.org/u/lyred)\
**Post date:** [19 April 2021 09:11 UTC](https://discourse.nodered.org/t/cant-recover-mail-adresse-ui-form/44392/1 "2021-04-19T09:11:37Z")

</div>

hello,  
I want to use a ui\_form to insert my email address and when I click on the "submit" button the address mentioned will be transferred to the "mail" node but I cannot recover this address with the **msg.payload**  
 ![1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/4/7443698217e9cbf220223fd49b7a144e1cabef51.png) ![2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/e/bedba1750f983dbe44450abe4990daf00e53ceb5.png)

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [19 April 2021 09:23 UTC](https://discourse.nodered.org/t/cant-recover-mail-adresse-ui-form/44392/2 "2021-04-19T09:23:19Z")

</div>

As the info sidebar help for the email node says

"Sends the `msg.payload` as an email, with a subject of `msg.topic` .

The default message recipient can be configured in the node, if it is left blank it should be set using the `msg.to` property of the incoming message. If left blank you can also specify any or all of: `msg.cc` , `msg.bcc` , `msg.replyTo` , `msg.inReplyTo` , `msg.references` , `msg.headers` , or `msg.priority` properties."

so you need to use a change node to move the payload from the form to the to field.

---

<div class="post-metadata">

**Author:** ![lyred](https://avatars.discourse-cdn.com/v4/letter/l/ccd318/32.png) [@lyred](https://discourse.nodered.org/u/lyred)\
**Post date:** [19 April 2021 10:05 UTC](https://discourse.nodered.org/t/cant-recover-mail-adresse-ui-form/44392/3 "2021-04-19T10:05:47Z")

</div>

Hello, thanks for your response

I tried with a **node red : function** but I couldn't, do you have an example please?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [19 April 2021 10:18 UTC](https://discourse.nodered.org/t/cant-recover-mail-adresse-ui-form/44392/4 "2021-04-19T10:18:27Z")

</div>

Maybe a change node like this

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

Or a function like this

```auto
msg.to = msg.payload;
msg.payload = "hello world";
return msg;

```

---

<div class="post-metadata">

**Author:** ![lyred](https://avatars.discourse-cdn.com/v4/letter/l/ccd318/32.png) [@lyred](https://discourse.nodered.org/u/lyred)\
**Post date:** [19 April 2021 10:42 UTC](https://discourse.nodered.org/t/cant-recover-mail-adresse-ui-form/44392/5 "2021-04-19T10:42:00Z")

</div>

for summary,  
I left (To) empty in email node, and I put exactly the same function as you but it tells me an error **Error: No recipients defined**  
I also tried change mode exactly like you and I had the same **error**  
I think that’s because the **msg.paylod** has name: address of ui\_form !!

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [19 April 2021 12:35 UTC](https://discourse.nodered.org/t/cant-recover-mail-adresse-ui-form/44392/6 "2021-04-19T12:35:43Z")

</div>

Well add a debug after the form node to see what the payload properties are...  
It may be that you need `msg.payload.something` where something is whatever you called the "Votre email" field.

---

<div class="post-metadata">

**Author:** ![lyred](https://avatars.discourse-cdn.com/v4/letter/l/ccd318/32.png) [@lyred](https://discourse.nodered.org/u/lyred)\
**Post date:** [19 April 2021 13:57 UTC](https://discourse.nodered.org/t/cant-recover-mail-adresse-ui-form/44392/7 "2021-04-19T13:57:37Z")

</div>

Thank You !

---

<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:** [3 May 2021 13:58 UTC](https://discourse.nodered.org/t/cant-recover-mail-adresse-ui-form/44392/8 "2021-05-03T13:58:33Z")

</div>

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