# Set email recipient from POST

**URL:** <https://discourse.nodered.org/t/set-email-recipient-from-post/9256>\
**Category:** General\
**Created:** [21 March 2019 00:03 UTC](https://discourse.nodered.org/t/set-email-recipient-from-post/9256 "2019-03-21T00:03:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![defremont](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/defremont/32/6893_2.png) [@defremont](https://discourse.nodered.org/u/defremont)\
**Post date:** [21 March 2019 00:03 UTC](https://discourse.nodered.org/t/set-email-recipient-from-post/9256/1 "2019-03-21T00:03:05Z")

</div>

Hello, i'm able to send email when access "127.0.0.1:1880/hello" or make a GET request with this flow:

```auto
[{"id":"b84d8811.9408d8","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"515bb640.bd9fe8","type":"debug","z":"b84d8811.9408d8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":450,"y":180,"wires":[]},{"id":"ec6d8ce8.61ad7","type":"e-mail","z":"b84d8811.9408d8","server":"smtp.gmail.com","port":"465","secure":true,"tls":true,"name":"andre.def93@gmail.com","dname":"","x":500,"y":320,"wires":[]},{"id":"50ac67db.e35b38","type":"http response","z":"b84d8811.9408d8","name":"","statusCode":"","headers":{},"x":670,"y":260,"wires":[]},{"id":"b844e609.5261a8","type":"http in","z":"b84d8811.9408d8","name":"","url":"/hello","method":"get","upload":false,"swaggerDoc":"","x":120,"y":260,"wires":[["515bb640.bd9fe8","ec6d8ce8.61ad7","50ac67db.e35b38"]]}]

```

![Screenshot%20from%202019-03-20%2021-01-48](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/9/952144583c73e0b1817d5a7c00d6f9cb8a824ae9.png)  
But actually i need to make a POST that changes the recipient of email... I read that i need to change the msg.to. But i don't know how to make this trough Postman (for example) and if i need to one more msg.to node.

Is a simples question, any help is welcome.

---

<div class="post-metadata">

**Author:** ![defremont](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/defremont/32/6893_2.png) [@defremont](https://discourse.nodered.org/u/defremont)\
**Post date:** [21 March 2019 00:52 UTC](https://discourse.nodered.org/t/set-email-recipient-from-post/9256/2 "2019-03-21T00:52:10Z")

</div>

Solved!  
Change the flow to:

```auto
[{"id":"9d3a191d.f1cf68","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"e8ee7aa6.861908","type":"debug","z":"9d3a191d.f1cf68","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":450,"y":180,"wires":[]},{"id":"97d3c4b4.24f598","type":"e-mail","z":"9d3a191d.f1cf68","server":"smtp.gmail.com","port":"465","secure":true,"tls":true,"name":"","dname":"","x":650,"y":380,"wires":[]},{"id":"8446b5f7.7221f8","type":"http response","z":"9d3a191d.f1cf68","name":"","statusCode":"","headers":{},"x":670,"y":260,"wires":[]},{"id":"b06f5548.43ec78","type":"http in","z":"9d3a191d.f1cf68","name":"","url":"/hello","method":"post","upload":false,"swaggerDoc":"","x":130,"y":260,"wires":[["e8ee7aa6.861908","8446b5f7.7221f8","b8849fa0.281fd"]]},{"id":"b8849fa0.281fd","type":"function","z":"9d3a191d.f1cf68","name":"","func":"msg.to = msg.payload.to\nreturn msg;","outputs":1,"noerr":0,"x":320,"y":400,"wires":[["97d3c4b4.24f598"]]}]

```

And pass a body from post works good.
