Sending attachment via Gmail

Describe the problem/error/question

I am trying to send an email with an attachment using the Gmail node and get an error that I don’t understand. I am able to download that file from the original email and upload it to Google Drive, but for some reason using the same file as attachment in a forwarded email gives an error.

What is the error message (if any)?

property.split is not a function or its return value is not iterable (item 0)

Please share your workflow

Share the output returned by the last node

Please refer to screenshot above

Information on your n8n setup

  • n8n version: 1.44.1
  • Database (default: SQLite): SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main): default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: MacOS

Hi @Jan_Koch

Thanks for posting here and welcome to the community! :partying_face:

This is a pretty common issue we have when handling binary data. Since you need to reference the file in memory rather than provide the binary file itself.

This means instead of using an expression {{ $('Merge').item.binary.attachment_0 }} you only need to provide the attachment field name, like so:
attachment_0

This should work! :raised_hands:

Hi Ria,
thanks for the fast response! I just tried attachment_0 but that produced a different error.

The attachments are two nodes back from the one that is sending the email.

Hi @Jan_Koch

Sorry, my bad! You will need to provide the binary file again directly from the original Gmail node. You can do that by connecting it to another Merge node just before the Gmail forwarding node

Hope this makes sense?

1 Like

Will try that, thank you for the suggestion!

That worked! Thank you so much :slight_smile: :partying_face:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.