Email attachment

#1

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

0 Likes

#2

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.

1 Like

#3

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

[{"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":[]}]
0 Likes

#4

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.

0 Likes

#5

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

0 Likes

#6

Yes I can send email
but without the attachment

0 Likes

#7

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.

0 Likes

#8

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.

0 Likes

#9
[{"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":[]}]
0 Likes

#10

Thank you all very much for your help

0 Likes