Skip to content
Back to skills

Send Email

ASecurity

Send an email via Gmail SMTP. Body from target/value, headers as parameters. Returns confirmation Note with message-id in metadata.

  • 10 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added June 6, 2026
developmentpythongosecurity

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned June 6, 2026

npx -y skills add bdambrosio/Cognitive_workbench --skill send-email --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Send Email?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Send Email
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/bdambrosio-send-email/badge)](https://www.skillsdirectory.com/skills/bdambrosio-send-email)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: send-email
type: python
description: "Send an email via Gmail SMTP. Body from target/value, headers as parameters. Returns confirmation Note with message-id in metadata."
schema_hint:
  to: "string (recipient address, default: GMAIL_ADDRESS)"
  subject: "string (subject line, required)"
  target: "$variable (email body from prior step, optional)"
  value: "string (literal email body, optional)"
  cc: "string (CC addresses, comma-separated, optional)"
  bcc: "string (BCC addresses, comma-separated, optional)"
  reply_to: "string (Message-ID to thread under, optional)"
  out: "$variable (optional)"
---

# send-email

Send an email via Gmail SMTP using App Password authentication. The email body comes from `target` (a Note or Collection from a prior step) or `value` (literal text). Returns a confirmation Note with the sent message-id in metadata.

## Input

Body content (one of):

- `target`: Variable or resource ID — content becomes the email body (plain text)
- `value`: Literal string — used as the email body directly

Header parameters:

| Param | Required | Purpose |
|-------|----------|---------|
| `to` | no | Recipient address(es), comma-separated. Default: `GMAIL_ADDRESS` (the mailbox owner) |
| `subject` | yes | Subject line |
| `cc` | no | CC address(es), comma-separated |
| `bcc` | no | BCC address(es), comma-separated |
| `reply_to` | no | Message-ID to thread as a reply (sets In-Reply-To and References headers) |

## Output

Success (`status: "success"`):
- `resource_id`: Note ID containing confirmation text (e.g., `"Sent to alice@example.com: Meeting notes"`).
- Metadata (accessible via `get-metadata`): `message_id`, `to`, `cc`, `bcc`, `subject`, `timestamp`.

Failure (`status: "failed"`):
- `reason`: Error description (e.g., `GMAIL_ADDRESS and GMAIL_APP_PASSWORD environment variables required`, `authentication_failed`)

## Requirements

- `GMAIL_ADDRESS` — Gmail address (also the SMTP username and From address)
- `GMAIL_APP_PASSWORD` — 16-character App Password from Google Account > Security > App Passwords

## Behavior

- Connects via STARTTLS to `smtp.gmail.com:587`
- Sends as plain text (UTF-8)
- If `to` is omitted, sends to `GMAIL_ADDRESS` (the mailbox owner)
- From address is always `GMAIL_ADDRESS` (cannot be spoofed)
- Authentication errors return a generic failure message

## Common Workflows

**Notify the operator (omit `to` — sends to mailbox owner):**
```json
{"type":"generate-note","prompt":"Summarize today's completed tasks and any blockers","out":"$report"}
{"type":"send-email","target":"$report","subject":"Daily Agent Report","out":"$sent"}
```

**Send a generated report to someone else:**
```json
{"type":"generate-note","prompt":"Write a weekly status update covering: shipped auth module, started caching layer, blocked on DB migration","out":"$report"}
{"type":"send-email","target":"$report","to":"team@company.com","subject":"Weekly Status Update","out":"$sent"}
```

**Reply to an email found via check-email:**
```json
{"type":"check-email","from_addr":"alice@company.com","subject":"Q1 planning","limit":1,"out":"$thread"}
{"type":"extract","target":"$thread","instruction":"Extract the Message-ID header","out":"$msg_id"}
{"type":"send-email","value":"Thanks Alice, I'll review the Q1 plan and get back to you by Friday.","to":"alice@company.com","subject":"Re: Q1 planning","reply_to":"$msg_id","out":"$sent"}
```

**Send synthesized research:**
```json
{"type":"search-web","query":"latest developments in AI safety 2026","out":"$research"}
{"type":"synthesize","target":"$research","focus":"key takeaways","format":"executive","out":"$summary"}
{"type":"send-email","target":"$summary","to":"boss@company.com","subject":"AI Safety Brief - Feb 2026","out":"$sent"}
```

Files in this skill

  • Skill.md3.7 KB
  • tool.py12.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.