PluginBench
Skill
Pass
Audit score 90

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
Prerequisites
  • Google Workspace CLI (gws) installed and configured
  • Gmail API enabled in your Google Workspace project
  • Authentication configured via gws (see gws-shared/SKILL.md)
Claude Code
Cursor
Windsurf
Cline

How to use gws-gmail-send

  1. 1.Run `gws gmail +send --to <email> --subject '<subject>' --body '<text>'` with required flags
  2. 2.Add `--cc` and/or `--bcc` flags for additional recipients if needed
  3. 3.Use `--attach` (or `-a`) flag one or more times to include file attachments
  4. 4.Add `--html` flag if your --body contains HTML formatting instead of plain text
  5. 5.Use `--from <alias>` to send from a configured send-as alias instead of your primary address
  6. 6.Use `--draft` flag to save as draft instead of sending, or `--dry-run` to preview first

Use cases

Good for
  • 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
Who it's for
  • 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

What's the maximum attachment size?

Total attachment size is limited to 25MB per email.

Can I send to multiple recipients at once?

Yes. Use comma-separated addresses in --to, --cc, and --bcc flags.

Do I need to include HTML/body tags for HTML emails?

No. With --html, use fragment tags like <p>, <b>, <a>, <br> — no <html> or <body> wrapper needed.

How do I send from an alias instead of my primary address?

Use the --from flag with your configured send-as alias email address.

Can I preview the email before sending?

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.md for auth, global flags, and security rules. If missing, run gws generate-skills to create it.

Send an email

Usage

gws gmail +send --to <EMAILS> --subject <SUBJECT> --body <TEXT>

Flags

FlagRequiredDefaultDescription
--toRecipient email address(es), comma-separated
--subjectEmail subject
--bodyEmail body (plain text, or HTML with --html)
--fromSender address (for send-as/alias; omit to use account default)
--attachAttach a file (can be specified multiple times)
--ccCC email address(es), comma-separated
--bccBCC email address(es), comma-separated
--htmlTreat --body as HTML content (default is plain text)
--dry-runShow the request that would be sent without executing it
--draftSave 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