邮件与消息32k · #9171
gws-gmail-send
它能做什么
这个命令可以通过 Gmail 发送邮件。你可以指定邮件的收件人、主题和正文。
适用场景
- ✓给同事发一条简短的提醒。
- ✓向一个群体分享重要信息。
- ✓通过邮件确认约定好的见面。
技能链接
https://github.com/googleworkspace/cli/blob/main/skills/gws-gmail-send/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
请用这个技能帮我:https://github.com/googleworkspace/cli/blob/main/skills/gws-gmail-send/SKILL.md
阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
npx skills add googleworkspace/cli --skill gws-gmail-send
下载 SKILL.md,放进智能体的技能文件夹。
curl -L https://raw.githubusercontent.com/googleworkspace/cli/main/skills/gws-gmail-send/SKILL.md -o SKILL.md
可以这样问 AI
“给 john@example.com 发一封邮件,主题是“Meeting”,正文是“Hi John, let's meet tomorrow at 10 AM.””
每周 5 个新技能,1 分钟读完。
工作原理
你需要告诉它收件人是谁、邮件的主题是什么,以及正文要写些什么。排版和发送等步骤由命令自动完成。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
gmail +send
PREREQUISITE: Read
../gws-shared/SKILL.mdfor auth, global flags, and security rules. If missing, rungws generate-skillsto create it.
Send an email
Usage
gws gmail +send --to <EMAILS> --subject <SUBJECT> --body <TEXT>
Flags
| Flag | Required | Default | Description |
|---|---|---|---|
--to |
✓ | — | Recipient email address(es), comma-separated |
--subject |
✓ | — | Email subject |
--body |
✓ | — | Email body (plain text, or HTML with --html) |
--from |
— | — | Sender address (for send-as/alias; omit to use account default) |
--attach |
— | — | Attach a file (can be specified multiple times) |
--cc |
— | — | CC email address(es), comma-separated |
--bcc |
— | — | BCC email address(es), comma-separated |
--html |
— | — | Treat --body as HTML content (default is plain text) |
--dry-run |
— | — | Show the request that would be sent without executing it |
--draft |
— | — | Save as draft instead of sending |
Examples
gws gmail +send --to alice@example.com --subject 'Hello' --body 'Hi Alice!'
gws gmail +send --to alice@example.com --subject 'Hello' --body 'Hi!' --cc bob@example.com
gws gmail +send --to alice@example.com --subject 'Hello' --body '<b>Bold</b> text' --html
gws gmail +send --to alice@example.com --subject 'Hello' --body 'Hi!' --from alias@example.com
gws gmail +send --to alice@example.com --subject 'Report' --body 'See attached' -a report.pdf
gws gmail +send --to alice@example.com --subject 'Files' --body 'Two files' -a a.pdf -a b.csv
gws gmail +send --to alice@example.com --subject 'Hello' --body 'Hi!' --draft
Tips
- Handles RFC 5322 formatting, MIME encoding, and base64 automatically.
- Use --from to send from a configured send-as alias instead of your primary address.
- Use -a/--attach to add file attachments. Can be specified multiple times. Total size limit: 25MB.
- With --html, use fragment tags (<p>, <b>, <a>, <br>, etc.) — no <html>/<body> wrapper needed.
- Use --draft to save the message as a draft instead of sending it immediately.
[!CAUTION] This is a write command — confirm with the user before executing.
See Also
- gws-shared — Global flags and auth
- gws-gmail — All send, read, and manage email commands
常见问题
我可以同时发给多个人吗?
可以。只要用逗号把多个邮箱地址隔开就行。
我可以添加附件吗?
可以。使用 '--attach' 选项,后面跟上文件名即可。
我可以把邮件存为草稿,而不是直接发送吗?
可以。使用 '--draft' 选项即可。
详情
热度
- GitHub 星标
- 32k
- 排名
- #9171
- 许可证
- Apache-2.0
- 更新时间
- 2026/10/6
评论
- …