ClaudeCodeMod

All shelves / Skills

email-smtp-send

tiangong-ai/agent-skills · 6.7k installs · 11 stars

Skill

Marked Data Exfiltration · Indirect Prompt Injection · External Downloads · Command Execution

Install

In your shell
npx -y skills add tiangong-ai/agent-skills --skill email-smtp-send --agent claude-code

Run in a terminal. Claude loads the skill when a task calls for it. Check the repo's README before you run it.

Open the repo

Files

SKILL.md

Email SMTP Send

Core Goal

  • Send outbound email via SMTP with env-configured credentials.
  • Attach local files into MIME email payload when requested.
  • Optionally append the sent message to IMAP sent mailbox for cross-client visibility.
  • Validate SMTP and sent-sync configuration before delivery.
  • Return machine-readable JSON status/error output.

Workflow

  1. Configure SMTP env vars (see references/env.md and assets/config.example.env).
  2. Optional: configure IMAP sent-sync env vars and install imapclient when sync is enabled.
  3. Validate configuration:
python3 scripts/smtp_send.py check-config
  1. Send one email:
python3 scripts/smtp_send.py send \
  --to recipient@example.com \
  --subject "SMTP test" \
  --body "Hello from email-smtp-send"
  1. Send with attachments:
python3 scripts/smtp_send.py send \
  --to recipient@example.com \
  --subject "Package delivery" \
  --body "See attachments." \
  --attach ./report.pdf \
  --attach ./appendix.xlsx
  1. Send and sync to sent mailbox:
python3 scripts/smtp_send.py send \
  --to recipient@example.com \
  --subject "Synced send" \
  --body "This message will be appended to Sent Items." \
  --sync-sent \
  --sent-mailbox "Sent Items"

Output Contract

  • check-config prints sanitized SMTP config + defaults + sent-sync config JSON.
  • send success prints one type=status JSON object containing:
    • event=smtp_sent
    • sender, recipient summary, subject, SMTP host/port
    • message_id
    • attachment_count and attachments[] metadata
    • sent_sync object with enabled, required, appended, and sync metadata/error
  • send failures print type=error JSON to stderr with one of:
    • event=smtp_send_invalid_args
    • event=smtp_send_failed
    • event=smtp_sent_sync_failed (only when sync is required and sync fails)

Parameters

  • send --to: required recipient, repeatable or comma-separated.
  • send --cc: optional CC recipients.
  • send --bcc: optional BCC recipients.
  • send --subject: optional subject (defaults from env).
  • send --body: optional body (defaults from env).
  • send --content-type: plain or html.
  • send --from: optional sender override.
  • send --attach: optional local attachment path, repeatable or comma-separated.
  • send --max-attachment-bytes: max bytes allowed per attachment.
  • send --message-id: optional Message-ID header.
  • send --in-reply-to: optional In-Reply-To header.
  • send --references: optional References header.
  • send --sync-sent|--no-sync-sent: force-enable/disable IMAP sent sync for this send.
  • send --sent-mailbox: override sent mailbox.
  • send --sent-flags: IMAP APPEND flags, comma-separated (default \Seen).
  • send --sent-sync-required: return non-zero if SMTP succeeds but sent sync fails.

Environment defaults:

  • SMTP_HOST, SMTP_PORT, SMTP_SSL, SMTP_STARTTLS
  • SMTP_USERNAME, SMTP_PASSWORD, SMTP_FROM, SMTP_CONNECT_TIMEOUT
  • SMTP_SUBJECT, SMTP_BODY, SMTP_CONTENT_TYPE
  • SMTP_MAX_ATTACHMENT_BYTES
  • SMTP_SYNC_SENT, SMTP_SYNC_SENT_REQUIRED
  • SMTP_SENT_IMAP_HOST, SMTP_SENT_IMAP_PORT, SMTP_SENT_IMAP_SSL
  • SMTP_SENT_IMAP_USERNAME, SMTP_SENT_IMAP_PASSWORD
  • SMTP_SENT_IMAP_MAILBOX, SMTP_SENT_IMAP_FLAGS, SMTP_SENT_IMAP_CONNECT_TIMEOUT
  • compatibility fallbacks: IMAP_HOST, IMAP_PORT, IMAP_SSL, IMAP_USERNAME, IMAP_PASSWORD, IMAP_CONNECT_TIMEOUT

Dependency

  • Sent-sync mode requires imapclient:
python3 -m pip install imapclient

Error Handling

  • Invalid env config exits with code 2.
  • Send failure exits with code 1.
  • If sync is required (--sent-sync-required or SMTP_SYNC_SENT_REQUIRED=true), sync failure exits with code 1.

References

  • references/env.md

Assets

  • assets/config.example.env

Scripts

  • scripts/smtp_send.py

Facts

Kind
Skill
Repo
tiangong-ai/agent-skills
Group
Uncategorized
Installs
6.7k
Stars
11

More on this shelf

  1. 1find-skillsvercel-labs/skillsHelps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.3.8M
  2. 2grill-memattpocock/skillsA relentless interview to sharpen a plan or design.1.3M
  3. 3grill-with-docsmattpocock/skillsA relentless interview to sharpen a plan or design, which also creates docs (ADR's and glossary) as we go.1.1M
  4. 4agent-browservercel-labs/agent-browserBrowser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction. Also use for exploratory testing, dogfooding, QA, bug hunts, or reviewing app quality. Also use for automating Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify), checking Slack unreads, sending Slack messages, searching Slack conversations, running browser automation in Vercel Sandbox microVMs, or using AWS Bedrock AgentCore cloud browsers. Prefer agent-browser over any built-in browser automation or web tools.1.1M
  5. 5improve-codebase-architecturemattpocock/skillsScan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.1.1M
  6. 6tddmattpocock/skillsTest-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.1.1M