# Email attachment

**URL:** <https://discourse.nodered.org/t/email-attachment/1373>\
**Category:** General\
**Created:** [5 July 2018 17:30 UTC](https://discourse.nodered.org/t/email-attachment/1373 "2018-07-05T17:30:32Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![barry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/barry/32/1022_2.png) [@barry](https://discourse.nodered.org/u/barry)\
**Post date:** [5 July 2018 17:30 UTC](https://discourse.nodered.org/t/email-attachment/1373/1 "2018-07-05T17:30:32Z")

</div>

Hi Guys,  
I’m relatively new to programing and would appreciate any help.  
I’ve created an .ods document and would like to email it as an attachment.  
Regard  
Barry

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [5 July 2018 17:40 UTC](https://discourse.nodered.org/t/email-attachment/1373/2 "2018-07-05T17:40:41Z")

</div>

if you look at the info panel for the email node it will tell you where in the msg object files you want to send as an attachment need to be.

So you need to upload the file into your flow using one of the file nodes and then “move” it from msg.payload to where the email node tells you attachments need to be  
you can do this using a change node.

---

<div class="post-metadata">

**Author:** ![barry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/barry/32/1022_2.png) [@barry](https://discourse.nodered.org/u/barry)\
**Post date:** [5 July 2018 17:53 UTC](https://discourse.nodered.org/t/email-attachment/1373/3 "2018-07-05T17:53:15Z")

</div>

I’m having difficulty following the process. This is what I have so far.

```auto
[{"id":"c4da5371.210d9","type":"inject","z":"716e078a.2ee618","name":"","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":220,"wires":[["d42a2697.70dd28"]]},{"id":"d42a2697.70dd28","type":"file in","z":"716e078a.2ee618","name":"Batch Delivered","filename":"/home/pi/node-red/Batch Delivered.ods","format":"utf8","chunk":false,"sendError":false,"x":280,"y":100,"wires":[["435f2654.720bb8"]]},{"id":"435f2654.720bb8","type":"change","z":"716e078a.2ee618","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"attachments","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":300,"wires":[["36f7b216.68810e","b54f503c.5512f"]]},{"id":"36f7b216.68810e","type":"e-mail","z":"716e078a.2ee618","server":"smtp.gmail.com","port":"465","secure":true,"name":"barry@miller-remote.com","dname":"Barry @Miller-Remote","x":800,"y":240,"wires":[]},{"id":"b54f503c.5512f","type":"debug","z":"716e078a.2ee618","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":780,"y":140,"wires":[]}]

```

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [5 July 2018 19:46 UTC](https://discourse.nodered.org/t/email-attachment/1373/4 "2018-07-05T19:46:38Z")

</div>

When you post a flow you have to precede it with a line containing three backticks (that is the key next to ‘1’ on my keyboard) and after the flow also insert a line with three backticks. Without those quotes are converted to smart quotes and we cannot import it. Please go back and edit your previous post (use the pen icon at the bottom of the post) and insert those lines. Then we will be able to look at it.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [5 July 2018 20:01 UTC](https://discourse.nodered.org/t/email-attachment/1373/5 "2018-07-05T20:01:36Z")

</div>

Also, are you able to send the email without the attachment ok?

---

<div class="post-metadata">

**Author:** ![barry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/barry/32/1022_2.png) [@barry](https://discourse.nodered.org/u/barry)\
**Post date:** [5 July 2018 20:19 UTC](https://discourse.nodered.org/t/email-attachment/1373/6 "2018-07-05T20:19:07Z")

</div>

Yes I can send email  
but without the attachment

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [5 July 2018 20:53 UTC](https://discourse.nodered.org/t/email-attachment/1373/7 "2018-07-05T20:53:34Z")

</div>

Can you quote the bit from the email info tab that relates to how you are trying to send the attachment? I ask as there are two ways of doing it and I need to understand which you are trying to do.

---

<div class="post-metadata">

**Author:** ![barry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/barry/32/1022_2.png) [@barry](https://discourse.nodered.org/u/barry)\
**Post date:** [6 July 2018 12:28 UTC](https://discourse.nodered.org/t/email-attachment/1373/8 "2018-07-06T12:28:06Z")

</div>

Sorry Colin  
But I don't understand your question.  
I have a .csv file  
I attempt to attach it to an email, as an attachment, using a change node.  
The email gets sent with the contents of the .csv file in the body of the email.

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [6 July 2018 12:38 UTC](https://discourse.nodered.org/t/email-attachment/1373/9 "2018-07-06T12:38:45Z")

</div>

```
[{"id":"c9c68386.8e578","type":"inject","z":"ef4c8fc3.4375b","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":180,"wires":[["1741bf96.e3c538"]]},{"id":"1741bf96.e3c538","type":"file in","z":"ef4c8fc3.4375b","name":"","filename":"TYPE THE FULL PATH TO THE FILE HERE","format":"","chunk":false,"sendError":false,"x":330,"y":180,"wires":[["c81db63b.f5b708"]]},{"id":"c81db63b.f5b708","type":"change","z":"ef4c8fc3.4375b","name":"","rules":[{"t":"set","p":"attachments","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":260,"wires":[["60dc3d9d.3373e4"]]},{"id":"60dc3d9d.3373e4","type":"debug","z":"ef4c8fc3.4375b","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":700,"y":340,"wires":[]}]
```

---

<div class="post-metadata">

**Author:** ![barry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/barry/32/1022_2.png) [@barry](https://discourse.nodered.org/u/barry)\
**Post date:** [6 July 2018 12:44 UTC](https://discourse.nodered.org/t/email-attachment/1373/10 "2018-07-06T12:44:51Z")

</div>

Thank you all very much for your help
