Hi all,
I’m looking for some help with a flow. I would like to attach a file on my email. The node-red is successfully sending it, but unfortunately while receiving it. it appears to be a invalid file with no data on it.
Your input on resoling this issue highly appreciated.
[
{
"id": "f6cfd0144d7f0ade",
"type": "inject",
"z": "9436f441bf6223e5",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 180,
"y": 80,
"wires": [
[
"68fa5e8c01fd96f3"
]
]
},
{
"id": "68fa5e8c01fd96f3",
"type": "file in",
"z": "9436f441bf6223e5",
"name": "",
"filename": "/Shared/ONLINE/read_send_test.txt",
"filenameType": "str",
"format": "",
"chunk": false,
"sendError": false,
"encoding": "none",
"allProps": false,
"x": 230,
"y": 160,
"wires": [
[
"c67282934acdcc28",
"11fde0f7462e2601"
]
]
},
{
"id": "c67282934acdcc28",
"type": "change",
"z": "9436f441bf6223e5",
"name": "",
"rules": [
{
"t": "set",
"p": "attachments",
"pt": "msg",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 540,
"y": 160,
"wires": [
[
"9bd459d05a7dcc99",
"d9f16e1b29146ad0"
]
]
},
{
"id": "11fde0f7462e2601",
"type": "debug",
"z": "9436f441bf6223e5",
"name": "debug 34",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 140,
"y": 260,
"wires": []
},
{
"id": "9bd459d05a7dcc99",
"type": "function",
"z": "9436f441bf6223e5",
"name": "Email Draft",
"func": "let temp = msg.attachments;\n\nmsg.from = \"xxxxxx@gmail.com\";\nmsg.cc = \"yyyyy@gmail.com\";\nmsg.topic = \"Attachment check \" \n\nmsg.attachments = temp;\n\nmsg.description = \"- Auto Re-start at 6AM \"\n\n\nmsg.payload = \"Hello World Attachment Test\";\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 750,
"y": 160,
"wires": [
[
"55ac7cce3d36c917",
"282bb48371ea445f"
]
]
},
{
"id": "d9f16e1b29146ad0",
"type": "debug",
"z": "9436f441bf6223e5",
"name": "debug 35",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 400,
"y": 260,
"wires": []
},
{
"id": "55ac7cce3d36c917",
"type": "e-mail",
"z": "9436f441bf6223e5",
"server": "smtp.gmail.com",
"port": "465",
"secure": true,
"tls": true,
"name": "",
"dname": "Attachment Check | Node-Red",
"x": 990,
"y": 160,
"wires": []
},
{
"id": "282bb48371ea445f",
"type": "debug",
"z": "9436f441bf6223e5",
"name": "debug 36",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 760,
"y": 260,
"wires": []
}
]