Skip to content
Agentmart
Submit a tool

email-automation

邮箱自动化:读取、搜索、草拟和发送邮件,支持 Gmail API 以及通用 IMAP/SMTP 流程。

Skill by aAAaqwq

IndexedMIT★ 111
Write a review

Chalk Labs

Need help deploying email-automation?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/aaaaqwq-email-automation

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

邮箱自动化:读取、搜索、草拟和发送邮件,支持 Gmail API 以及通用 IMAP/SMTP 流程。

Use cases: backend, productivity

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found
Runs as
Python package

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/email-automation

What's inside

Skill name
email-automation
Description
邮箱自动化:读取、搜索、草拟和发送邮件,支持 Gmail API 以及通用 IMAP/SMTP 流程。
License
MIT
Instructions
210 lines in SKILL.md · view on GitHub

Before installing

  • Ships executable scripts
  • Instructions call the network
  • Instructions read files in your home folder (~/.ssh, ~/.aws…)

Files (4)

  • SKILL.md
  • gmail_auth.py
  • gmail_read.py
  • gmail_send.py

SKILL.md (first lines)

# Email Automation Skill

- Author: Daniel Li
- Copyright © Daniel Li. All rights reserved.

邮箱自动化:读取、搜索、草拟、发送邮件。

## 支持的方式

### 方式 1: Gmail API (推荐)

**优点**: 功能完整,支持标签、搜索、草稿
**配置步骤**:

1. 访问 [Google Cloud Console](https://console.cloud.google.com/)
2. 创建项目 → 启用 Gmail API
3. 创建 OAuth 2.0 凭据(桌面应用)
4. 下载 `credentials.json`
5. 存储到 `~/.config/gmail/credentials.json`

```bash
# 安装依赖
pip3 install google-auth-oauthlib google-api-python-client

# 首次授权(会打开浏览器)
python3 ~/clawd/skills/email-automation/gmail_auth.py
```

### 方式 2: IMAP/SMTP (通用)

**优点**: 支持任何邮箱
**配置**:

```bash
# 存储凭据
pass insert email/gmail-address    # 邮箱地址
pass insert email/gmail-app-pass   # 应用专用密码(非登录密码)
```

Gmail 应用专用密码获取:
1. 访问 https://myaccount.google.com/apppasswords
2. 选择"邮件" + "其他设备"
3. 生成 16 位密码

### 方式 3: n8n 工作流

使用 n8n 的 Gmail/IMAP 节点,通过 webhook 触发。

---

## 核心功能

### 读取邮件

```python
# gmail_read.py
from googleapiclient.discovery import build
from google.oauth2.credentials import Credentials

creds = Credentials.from_authorized_user_file('token.json')
service = build('gmail', 'v1', credentials=creds)

# 获取最新 10 封邮件
results = service.users().messages().list(
    userId='me', maxResults=10, q='is:unread'
).execute()

for msg in results.get('messages', []):
    detail = service.users().messages().get(
        userId='me', id=msg['id'], format='metadata'
    ).execute()
    headers = {h['name']: h['value'] for h in detail['payload']['headers']}
    print(f"From: {headers.get('From')}")
    print(f"Subject: {headers.get('Subject')}")
    print("---")
```

### 搜索邮件

```python
# Gmail 搜索语法
queries = {
    "未读": "is:unread",
    "今天": "newer_than:1d",
    "重要": "is:important",
    "带附件": "has:attachment",
    "来自某人": "from:someone@example.com",
    "主题包含": "subject:关键词",
}
```

### 发送邮件

```python
# gmail_send.py
import base64
from email.mime.text import MIMEText

def create_message(to, subject, body):
    message = MIMEText(body)
    message['to'] = to
    message['subject'] = subject
    raw = base64.urlsafe_b64encode(message.as_bytes()).decode()
    return {'raw': raw}

def send_email(service, to, subject, body):
    message = create_message(to, subject, body)
    service.users().messages().send(userId='me', body=message).execute()
```

### IMAP 方式(备选)

```python
import imaplib
import email

# 连接
mail = imaplib.IMAP4_SSL('imap.gmail.com')
mail.login(EMAIL, APP_PASSWORD)

From aAAaqwq/AGI-Super-Team, MIT.

More from aAAaqwq/AGI-Super-Team

Signals

Stars
111
Forks
25
Open issues
1
Last commit (this folder)
Mar 31, 2026 (7 months ago)
Last release
Sep 20, 2026 (1 month ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from aAAaqwq

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get email-automation running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying email-automation?

CallGet help
Cite this page

email-automation skill. Agent Mart. https://agentmart.dev/skills/aaaaqwq-email-automation (last updated 2026-10-24)