---
id: ssh2-recipe-save-email-attachments
name: "recipe-save-email-attachments"
url: https://skills.yangsir.net/skill/ssh2-recipe-save-email-attachments
author: googleworkspace
domain: ai-productivity-automation
tags: ["gmail-attachments", "google-drive", "email-automation", "file-storage", "productivity-workflows"]
install_count: 15100
rating: 4.50 (152 reviews)
github: https://github.com/googleworkspace/cli
---

# recipe-save-email-attachments

> 查找带有附件的Gmail邮件，并将这些附件保存到Google云端硬盘中，便于管理和访问。

**Stats**: 15,100 installs · 4.5/5 (152 reviews)

## Before / After 对比

### 自动保存邮件附件，告别手动下载。

## Readme

# Save Gmail Attachments to Google Drive

> **PREREQUISITE:** Load the following skills to execute this recipe: `gws-gmail`, `gws-drive`

Find Gmail messages with attachments and save them to a Google Drive folder.

## Steps

1. Search for emails with attachments: `gws gmail users messages list --params '{"userId": "me", "q": "has:attachment from:client@example.com"}' --format table`
2. Get message details: `gws gmail users messages get --params '{"userId": "me", "id": "MESSAGE_ID"}'`
3. Download attachment: `gws gmail users messages attachments get --params '{"userId": "me", "messageId": "MESSAGE_ID", "id": "ATTACHMENT_ID"}'`
4. Upload to Drive folder: `gws drive +upload --file ./attachment.pdf --parent FOLDER_ID`



---
*Source: https://skills.yangsir.net/skill/ssh2-recipe-save-email-attachments*
*Markdown mirror: https://skills.yangsir.net/api/skill/ssh2-recipe-save-email-attachments/markdown*