# Sending attachment via Gmail

**URL:** <https://community.n8n.io/t/sending-attachment-via-gmail/48464>\
**Category:** Questions\
**Tags:** gmail, binary-data\
**Created:** [June 14, 2024, 6:58am UTC](https://community.n8n.io/t/sending-attachment-via-gmail/48464 "2024-06-14T06:58:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jan\_Koch](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jan_koch/32/30686_2.png) [@Jan\_Koch](https://community.n8n.io/u/Jan_Koch)\
**Post date:** [June 14, 2024, 6:58am UTC](https://community.n8n.io/t/sending-attachment-via-gmail/48464/1 "2024-06-14T06:58:57Z")

</div>

## 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)

 ![Xnapper-2024-06-14-08.55.37](https://europe1.discourse-cdn.com/n8n/original/3X/1/c/1c5e92f7907b30601d7738c14c789a7c97f882b4.jpeg)

## 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**

---

<div class="post-metadata">

**Author:** ![ria](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/ria/32/99251_2.png) [@ria](https://community.n8n.io/u/ria)\
**Post date:** [June 14, 2024, 9:33am UTC](https://community.n8n.io/t/sending-attachment-via-gmail/48464/2 "2024-06-14T09:33:36Z")

</div>

Hi @Jan_Koch

Thanks for posting here and welcome to the community! 🥳

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! 🙌

---

<div class="post-metadata">

**Author:** ![Jan\_Koch](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jan_koch/32/30686_2.png) [@Jan\_Koch](https://community.n8n.io/u/Jan_Koch)\
**Post date:** [June 14, 2024, 10:34am UTC](https://community.n8n.io/t/sending-attachment-via-gmail/48464/3 "2024-06-14T10:34:35Z")

</div>

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.

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/8/6/86711e4aca5f1642acb8d4a9572904c38da7f07a.jpeg)

---

<div class="post-metadata">

**Author:** ![ria](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/ria/32/99251_2.png) [@ria](https://community.n8n.io/u/ria)\
**Post date:** [June 14, 2024, 1:02pm UTC](https://community.n8n.io/t/sending-attachment-via-gmail/48464/4 "2024-06-14T13:02:48Z")

</div>

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

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/1/8/1823fa6f89c53bf5c33415ddbc348ba2815c4c8c.png)

Hope this makes sense?

---

<div class="post-metadata">

**Author:** ![Jan\_Koch](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jan_koch/32/30686_2.png) [@Jan\_Koch](https://community.n8n.io/u/Jan_Koch)\
**Post date:** [June 14, 2024, 2:47pm UTC](https://community.n8n.io/t/sending-attachment-via-gmail/48464/5 "2024-06-14T14:47:35Z")

</div>

Will try that, thank you for the suggestion!

---

<div class="post-metadata">

**Author:** ![Jan\_Koch](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jan_koch/32/30686_2.png) [@Jan\_Koch](https://community.n8n.io/u/Jan_Koch)\
**Post date:** [June 14, 2024, 3:08pm UTC](https://community.n8n.io/t/sending-attachment-via-gmail/48464/6 "2024-06-14T15:08:45Z")

</div>

That worked! Thank you so much 🙂 🥳

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/195824_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [June 21, 2024, 3:09pm UTC](https://community.n8n.io/t/sending-attachment-via-gmail/48464/7 "2024-06-21T15:09:39Z")

</div>

Closed on June 21, 2024, 3:09pm UTC

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