nka
July 25, 2025, 6:43pm
1
I’ve seen a lot of topics about this, tried many solution and I can’t seem to make it work.
Mailpit is sending the email trough the web socket, then I’m able to relay the email without any issue… except for the attachment.
Right now, this is were I am… and i’m getting the error options.attachments.split is not a function
What I’m receiving the the “GetMessage” look like this :
I also used the “Merge” node as else, I’m not able to use the data from “GetMessage” on the Send Mail node.
Tried to use Aggragate, but seems to do pretty much the same as the Code node, maybe more visual.
Tried to convert into binary using the “base64 to string” node too.
The attachments field is Send Email node is not expecting the
{{ $('Merge').item.binary }}
it expects the binary property name - a text in orange you usually see above the binary in the input pane - usually it is data or attachment of attachment_x… see what it is for you.
nka
July 25, 2025, 7:06pm
3
Hum…
I’m not sure to understand. While doing test, I’ve moved to the “Aggregate” node, using the “Attachements” field.
But I can’t use this field… even if I select the Attachments[0], I’m still getting the split error.
edit: Tried {{ $('Merge').item.binary }} with same split error.
In aggregate there is an option for including binaries.
Also don’t aggregate based on the text field “Attachments”, aggregate actual binaries.
Here, see 4 items coming in, 1 coming out:
nka
July 25, 2025, 7:16pm
5
Oh, right… just found the option “include binary” !
Now I have the option to use {{ $binary }} in the attachment field, but still getting that “split function” error.
nka
July 25, 2025, 7:19pm
6
Ah! got it using {{ Object.keys($binary).join(",") }}
Now, need to fix the filename!
Thanks a lot
Great, glad we got you back on track!
1 Like
nka
July 25, 2025, 7:57pm
8
In case anyone need it, here’s my final working version.
1 Like