AgentSkillsCN

sendemail

通过Gmail SMTP发送电子邮件通知。适用于完成耗时较长的任务、上报需要关注的结果、发送摘要或报告,或在被明确要求发送邮件时使用。

SKILL.md
--- frontmatter
name: sendemail
description: |
  Send email notifications via Gmail SMTP. Use when: completing long-running tasks,
  reporting results that need attention, sending summaries or reports, or when
  explicitly asked to email something.

Send Email

Send emails using Gmail SMTP.

Setup

Requires:

  1. Gmail account with App Password enabled (see SETUP.md)
  2. The sendemail script installed at ~/.claude/bin/sendemail

Usage

bash
~/.claude/bin/sendemail --subject "Subject line" --body "Message body"

Options

FlagDescription
--subject, -sEmail subject (required)
--body, -bMessage body text
--body-file, -fRead body from file
--to, -tRecipient email address

Examples

bash
# Simple notification
~/.claude/bin/sendemail -s "Task complete" -b "Build finished successfully."

# From file
~/.claude/bin/sendemail -s "Daily Report" -f /path/to/report.txt

# Piped content
echo "Results: 47 files processed" | ~/.claude/bin/sendemail -s "Processing done"

When to Use

  • After long-running tasks complete (builds, scrapes, analyses)
  • When results need the user's attention
  • Sending reports or summaries
  • When user explicitly asks to "email me" something

Compared to Other Notifications

MethodUse Case
sendemailDetailed reports, results that need review later
imessageQuick alerts, time-sensitive notifications (macOS only)
callmeInteractive discussion, blocking questions (Telegram)

Configuration

The script reads credentials from:

  • ~/.config/secrets/gmail-app-password — Your Gmail app password
  • ~/.config/secrets/gmail-sender-email — Your Gmail address (or hardcode in script)

See SETUP.md for credential configuration.