$npx -y skills add googleworkspace/cli --skill gws-gmail-sendGmail: Send an email.
| 1 | # gmail +send |
| 2 | |
| 3 | > **PREREQUISITE:** Read `../gws-shared/SKILL.md` for auth, global flags, and security rules. If missing, run `gws generate-skills` to create it. |
| 4 | |
| 5 | Send an email |
| 6 | |
| 7 | ## Usage |
| 8 | |
| 9 | ```bash |
| 10 | gws gmail +send --to <EMAILS> --subject <SUBJECT> --body <TEXT> |
| 11 | ``` |
| 12 | |
| 13 | ## Flags |
| 14 | |
| 15 | | Flag | Required | Default | Description | |
| 16 | |------|----------|---------|-------------| |
| 17 | | `--to` | ✓ | — | Recipient email address(es), comma-separated | |
| 18 | | `--subject` | ✓ | — | Email subject | |
| 19 | | `--body` | ✓ | — | Email body (plain text, or HTML with --html) | |
| 20 | | `--from` | — | — | Sender address (for send-as/alias; omit to use account default) | |
| 21 | | `--attach` | — | — | Attach a file (can be specified multiple times) | |
| 22 | | `--cc` | — | — | CC email address(es), comma-separated | |
| 23 | | `--bcc` | — | — | BCC email address(es), comma-separated | |
| 24 | | `--html` | — | — | Treat --body as HTML content (default is plain text) | |
| 25 | | `--dry-run` | — | — | Show the request that would be sent without executing it | |
| 26 | | `--draft` | — | — | Save as draft instead of sending | |
| 27 | |
| 28 | ## Examples |
| 29 | |
| 30 | ```bash |
| 31 | gws gmail +send --to alice@example.com --subject 'Hello' --body 'Hi Alice!' |
| 32 | gws gmail +send --to alice@example.com --subject 'Hello' --body 'Hi!' --cc bob@example.com |
| 33 | gws gmail +send --to alice@example.com --subject 'Hello' --body '<b>Bold</b> text' --html |
| 34 | gws gmail +send --to alice@example.com --subject 'Hello' --body 'Hi!' --from alias@example.com |
| 35 | gws gmail +send --to alice@example.com --subject 'Report' --body 'See attached' -a report.pdf |
| 36 | gws gmail +send --to alice@example.com --subject 'Files' --body 'Two files' -a a.pdf -a b.csv |
| 37 | gws gmail +send --to alice@example.com --subject 'Hello' --body 'Hi!' --draft |
| 38 | ``` |
| 39 | |
| 40 | ## Tips |
| 41 | |
| 42 | - Handles RFC 5322 formatting, MIME encoding, and base64 automatically. |
| 43 | - Use --from to send from a configured send-as alias instead of your primary address. |
| 44 | - Use -a/--attach to add file attachments. Can be specified multiple times. Total size limit: 25MB. |
| 45 | - With --html, use fragment tags (<p>, <b>, <a>, <br>, etc.) — no <html>/<body> wrapper needed. |
| 46 | - Use --draft to save the message as a draft instead of sending it immediately. |
| 47 | |
| 48 | > [!CAUTION] |
| 49 | > This is a **write** command — confirm with the user before executing. |
| 50 | |
| 51 | ## See Also |
| 52 | |
| 53 | - [gws-shared](../gws-shared/SKILL.md) — Global flags and auth |
| 54 | - [gws-gmail](../gws-gmail/SKILL.md) — All send, read, and manage email commands |