Overview
Thegws gmail +send helper command provides a simple interface for sending plain-text emails through Gmail. It automatically handles RFC 2822 message formatting and base64 URL-safe encoding required by the Gmail API.
Command Syntax
Parameters
Recipient email address
Email subject line
Email body content (plain text only)
Examples
Basic email
Send a simple plain-text email:Multi-line body
Send an email with a longer message:Using shell variables
Output Format
Returns a JSON object with the sent message details:How It Works
-
RFC 2822 Formatting: Constructs a properly formatted email message:
- Base64 Encoding: Encodes the message using URL-safe base64 encoding (required by Gmail API)
-
API Call: Executes
users.messages.sendwith the encoded message in therawfield -
Authentication: Uses OAuth2 with
gmail.modifyscope
Limitations
This helper is designed for simple plain-text emails. For advanced features, use the raw Gmail API:- HTML emails: Use the raw API with
Content-Type: text/html - Attachments: Use multipart MIME encoding
- CC/BCC recipients: Include
Cc:andBcc:headers - Custom headers: Add headers like
Reply-ToorX-*headers
Example with raw API
Related
- gws-gmail-send skill — AI agent integration
- gmail +triage — View unread emails
- gmail +watch — Stream new emails