smtp-email-sender

Send emails via SMTP (Gmail, Outlook, etc.). Supports attachments, HTML content, and multiple recipients. Use when user asks to send email, compose email, or email someone.

1,592 stars

Best use case

smtp-email-sender is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Send emails via SMTP (Gmail, Outlook, etc.). Supports attachments, HTML content, and multiple recipients. Use when user asks to send email, compose email, or email someone.

Teams using smtp-email-sender should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/smtp-email-sender/SKILL.md --create-dirs "https://raw.githubusercontent.com/openakita/openakita/main/skills/smtp-email-sender/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/smtp-email-sender/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How smtp-email-sender Compares

Feature / Agentsmtp-email-senderStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Send emails via SMTP (Gmail, Outlook, etc.). Supports attachments, HTML content, and multiple recipients. Use when user asks to send email, compose email, or email someone.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# SMTP Email Sender

通过 SMTP 协议发送邮件,支持 Gmail、Outlook、企业邮箱等。

## 前置要求

### 1. Gmail 用户

如果使用 Gmail,需要:
1. 启用两步验证
2. 创建应用专用密码(App Password)
   - 访问:https://myaccount.google.com/apppasswords
   - 选择"邮件"和应用名称
   - 复制生成的 16 位密码

### 2. Outlook/Hotmail 用户

1. 启用两步验证
2. 创建应用密码:https://account.microsoft.com/security
3. 或使用普通密码(如果允许)

### 3. 企业邮箱用户

联系 IT 部门获取:
- SMTP 服务器地址
- SMTP 端口(通常 587 或 465)
- 是否需要 SSL/TLS

## 配置

在 `.env` 文件中添加以下环境变量:

```bash
# SMTP 配置
SMTP_SERVER=smtp.gmail.com
SMTP_PORT=587
SMTP_USERNAME=your_email@gmail.com
SMTP_PASSWORD=your_app_password  # Gmail 使用应用专用密码
SMTP_USE_TLS=true
```

或者首次使用时运行配置脚本。

## 使用方法

### 基本用法

调用 `send_email.py` 脚本:

```bash
python scripts/send_email.py \
  --to recipient@example.com \
  --subject "邮件主题" \
  --body "邮件正文"
```

### 完整参数

| 参数 | 必需 | 说明 |
|------|------|------|
| `--to` | 是 | 收件人邮箱(多个用逗号分隔) |
| `--subject` | 是 | 邮件主题 |
| `--body` | 是 | 邮件正文 |
| `--cc` | 否 | 抄送邮箱(多个用逗号分隔) |
| `--bcc` | 否 | 密送邮箱(多个用逗号分隔) |
| `--attachment` | 否 | 附件路径(多个用逗号分隔) |
| `--is_html` | 否 | 正文是否为 HTML 格式(默认 false) |
| `--from_name` | 否 | 发件人显示名称 |

### 示例

**发送简单邮件**:
```bash
python scripts/send_email.py \
  --to friend@example.com \
  --subject "周末聚会" \
  --body "这周末有空吗?一起吃饭吧!"
```

**发送 HTML 邮件带附件**:
```bash
python scripts/send_email.py \
  --to boss@company.com \
  --subject "项目报告" \
  --body "<h1>项目进度报告</h1><p>详见附件...</p>" \
  --is_html true \
  --attachment "report.pdf,chart.xlsx" \
  --from_name "张三"
```

**发送给多人**:
```bash
python scripts/send_email.py \
  --to "alice@example.com,bob@example.com" \
  --cc "manager@example.com" \
  --subject "会议纪要" \
  --body "今天的会议纪要如下..."
```

## 支持的 SMTP 配置

### Gmail
```
SMTP_SERVER=smtp.gmail.com
SMTP_PORT=587
SMTP_USE_TLS=true
```

### Outlook/Hotmail
```
SMTP_SERVER=smtp-mail.outlook.com
SMTP_PORT=587
SMTP_USE_TLS=true
```

### QQ 邮箱
```
SMTP_SERVER=smtp.qq.com
SMTP_PORT=587
SMTP_USE_TLS=true
```

### 163 邮箱
```
SMTP_SERVER=smtp.163.com
SMTP_PORT=587
SMTP_USE_TLS=true
```

### 企业邮箱(示例)
```
SMTP_SERVER=smtp.company.com
SMTP_PORT=587
SMTP_USE_TLS=true
```

## 常见问题

### 1. 认证失败

**Gmail**:
- 确保启用了两步验证
- 使用应用专用密码,不是普通密码
- 检查是否开启了"不够安全的应用"访问(不推荐)

**Outlook**:
- 检查是否需要应用密码
- 确认 SMTP 地址正确

### 2. 连接超时

- 检查防火墙设置
- 尝试端口 465(SSL)代替 587(TLS)
- 确认 SMTP 服务器地址正确

### 3. 附件太大

- Gmail 限制 25MB
- Outlook 限制 20MB
- 大文件建议使用云盘链接

## 安全建议

1. **永远不要**在代码中硬编码密码
2. 使用环境变量或加密的配置文件
3. 定期更换应用专用密码
4. 不要在公共网络使用 SMTP 发送敏感信息

## 故障排除

运行测试脚本验证配置:

```bash
python scripts/test_smtp.py
```

如果测试失败,检查:
1. `.env` 文件配置是否正确
2. 网络连接是否正常
3. 邮箱账号密码是否正确
4. 防火墙是否阻止 SMTP 端口

Related Skills

openakita/skills@yuque-skills

1592
from openakita/openakita

Manage Yuque (语雀) knowledge bases, documents, and team collaboration through API integration. Supports personal search, weekly reports, knowledge base management, document CRUD, and group collaboration workflows. Based on yuque/yuque-skills.

openakita/skills@youtube-summarizer

1592
from openakita/openakita

Summarize YouTube videos by extracting transcripts and generating structured notes. Use when the user wants to summarize a YouTube video, extract key points from a talk, create study notes from a lecture, or get timestamps for important moments. Supports multiple URL formats and languages.

openakita/skills@xlsx

1592
from openakita/openakita

Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.

openakita/skills@xiaohongshu-creator

1592
from openakita/openakita

Create engaging Xiaohongshu (RED/小红书) content including titles, body text, hashtags, and image style recommendations. Supports multiple content types such as product reviews, tutorials, lifestyle sharing, and shopping guides with platform-specific optimization.

openakita/skills@wechat-article

1592
from openakita/openakita

Create and format WeChat Official Account (公众号) articles with proper Markdown-to-WeChat HTML conversion, rich formatting, cover image guidance, and both API and manual publishing workflows.

openakita/skills@webapp-testing

1592
from openakita/openakita

Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

openakita/skills@web-artifacts-builder

1592
from openakita/openakita

Suite of tools for creating elaborate, multi-component interactive HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use for complex artifacts requiring state management, routing, or shadcn/ui components - not for simple single-file HTML/JSX artifacts.

openakita/skills@video-downloader

1592
from openakita/openakita

Download YouTube videos with customizable quality and format options. Use this skill when the user asks to download, save, or grab YouTube videos. Supports various quality settings (best, 1080p, 720p, 480p, 360p), multiple formats (mp4, webm, mkv), and audio-only downloads as MP3.

openakita/skills@translate-pdf

1592
from openakita/openakita

Translate PDF documents while preserving original layout, styling, tables, images, and formatting. Supports Simplified Chinese, Traditional Chinese, English, Japanese, Korean, and more. Page-by-page translation with structure preservation.

openakita/skills@todoist-task

1592
from openakita/openakita

Manage Todoist tasks, projects, sections, labels, and filters via REST API v2. Supports task CRUD, due dates, priorities, recurring tasks, project organization, and advanced filtering. Based on doggy8088/agent-skills/todoist-api, using curl + jq.

openakita/skills@theme-factory

1592
from openakita/openakita

Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors/fonts that you can apply to any artifact that has been creating, or can generate a new theme on-the-fly.

write-file

1592
from openakita/openakita

Write content to file, creating new or overwriting existing. When you need to create new files, update file content, or save generated code/data.