gws-gmail-send
googleworkspace/cli
Send emails via Gmail with attachments, CC/BCC, HTML support, and draft options.
What is gws-gmail-send?
Sends emails through your Gmail account using the Google Workspace CLI. Use this to programmatically send messages with optional attachments, formatting, and recipient management from your agent.
- Send plain text or HTML emails to one or more recipients
- Attach files (up to 25MB total) to outgoing messages
- CC and BCC additional recipients on emails
- Send from configured Gmail aliases or your primary address
- Save messages as drafts instead of sending immediately
- Preview email requests with --dry-run before execution
How to install gws-gmail-send
npx skills add null --skill gws-gmail-send- Google Workspace CLI (gws) installed and configured
- Gmail API enabled in your Google Workspace project
- Authentication configured via gws (see gws-shared/SKILL.md)
How to use gws-gmail-send
- 1.Run `gws gmail +send --to <email> --subject '<subject>' --body '<text>'` with required flags
- 2.Add `--cc` and/or `--bcc` flags for additional recipients if needed
- 3.Use `--attach` (or `-a`) flag one or more times to include file attachments
- 4.Add `--html` flag if your --body contains HTML formatting instead of plain text
- 5.Use `--from <alias>` to send from a configured send-as alias instead of your primary address
- 6.Use `--draft` flag to save as draft instead of sending, or `--dry-run` to preview first
Use cases
- Automated notifications and alerts from your agent to stakeholders
- Sending reports or generated documents as email attachments
- Batch email distribution to multiple recipients with CC/BCC
- Creating draft emails for manual review before sending
- Sending formatted HTML emails with rich text and links
- Automation engineers building agent workflows
- Teams using Google Workspace for email infrastructure
- Developers integrating email notifications into applications
- Anyone needing programmatic Gmail access via CLI
gws-gmail-send FAQ
Total attachment size is limited to 25MB per email.
Yes. Use comma-separated addresses in --to, --cc, and --bcc flags.
No. With --html, use fragment tags like <p>, <b>, <a>, <br> — no <html> or <body> wrapper needed.
Use the --from flag with your configured send-as alias email address.
Yes. Use --dry-run to show the request without executing it, or --draft to save as a draft for manual review.
Full instructions (SKILL.md)
Source of truth, from googleworkspace/cli.
name: gws-gmail-send description: "Gmail: Send an email." metadata: version: 0.22.5 openclaw: category: "productivity" requires: bins: - gws cliHelp: "gws gmail +send --help"
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
Related skills
More from googleworkspace/cli and the wider catalog.
gws-gmail
Send, read, and manage Gmail emails via Google Workspace CLI.
gws-drive
Manage Google Drive files, folders, and shared drives via CLI.
gws-docs
Read and write Google Docs via command line.
gws-calendar
Manage Google Calendar events, calendars, and access control via CLI.
gws-sheets
Read and write Google Sheets spreadsheets via CLI.
gws-docs-write
Append plain text to the end of a Google Docs document.