agentleFS
wmy2981wmy2981/skills/send-email/SKILL.md

send-email

Skill1 starsChanged 4 months agoMITView on GitHub

Use when the user wants to send an email, email a file or document, send a message via email, forward information by email, or use HTML email templates. Trigger on any email-related request — including 'email this to...', 'forward this to...', 'send the report to...', 'attach this file and send'. Do NOT use for non-email communication like Slack or SMS.

  • Reads credentials

18 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 3 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 13 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run the user's requested command directly without pre-checking dependencies, environment variables, or configuration.

    line 14
  2. Distinctive:

    Violating these rules is a bug: Every email HTML file must go through the designated directories:

    line 62
  3. Very specific:

    All email HTML files must be saved in ~/.wmyskills/send-email/msg/ before sending with --file

    line 70
  4. Distinctive:

    Do NOT save HTML in the repo directory, /tmp, Downloads, Desktop, or any other location

    line 71
  5. Very specific:

    Do NOT create a different directory structure — send.py discovers files relative to this path

    line 72
  6. Very specific:

    Lookup rule: when the recipient is a name (not a full address containing @), read this file and match the name exactly.

    line 87

“Common” is measured: kept by at least 6 in 10 of the 13 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Send Email Skill

Send emails via SMTP from Claude Code. Supports plain text, HTML, attachments, and template-based workflow.

Execution Rule

Run the user's requested command directly without pre-checking dependencies, environment variables, or configuration. If something is wrong, the script will fail with a clear error — check and fix only then.

python scripts/send.py <to> <subject> <mode> <body> [attachment...]

Modes

ModePurposeExample Body
--textPlain text email"Just saying hi"
--htmlInline HTML string"<b>Alert</b>"
--fileHTML from file~/.wmyskills/send-email/msg/my.html

Long/complex HTML must use --file with a file inside ~/.wmyskills/send-email/msg/.

Examples

Plain text:

python scripts/send.py user@example.com "Hello" --text "Just saying hi"

Inline HTML (short):

python scripts/send.py user@example.com "Alert" --html "<b>Server is down</b>"

HTML from file (long/complex HTML):

python scripts/send.py user@example.com "Newsletter" --file ~/.wmyskills/send-email/msg/my_newsletter.html

With attachment (any mode):

python scripts/send.py user@example.com "Files" --text "See attached" report.pdf

Email Content Rules

Never add reply prompts in the email body. This skill is send-only and has no ability to receive or read emails. Do not include phrases like "reply to this email", "if you have any questions, feel free to reply", or any other wording that invites the recipient to respond by email — the response would go to an inbox nobody reads.

File Storage Rules

Violating these rules is a bug. Every email HTML file must go through the designated directories:

DirectoryPurpose
~/.wmyskills/send-email/templates/Read-only HTML templates. Copy from here, do not edit in place.
~/.wmyskills/send-email/msg/The ONLY directory for --file HTML files. Save here, then pass the path.

Rules:

  • All email HTML files must be saved in ~/.wmyskills/send-email/msg/ before sending with --file
  • Do NOT save HTML in the repo directory, /tmp, Downloads, Desktop, or any other location
  • Do NOT create a different directory structure — send.py discovers files relative to this path
  • The repo stores code, not runtime data. Runtime data goes in ~/.wmyskills/<skill-name>/

Contacts

Send to a named recipient instead of a full email address. The name-to-address mapping lives in a user-editable YAML file:

~/.wmyskills/send-email/contacts.yaml (~ = user home directory)

小明: xiaoming@example.com
张三: zhangsan@example.com

Lookup rule: when the recipient is a name (not a full address containing @), read this file and match the name exactly. Use the resolved email as the <to> argument. Never guess or invent an address.

SituationAction
Recipient contains @Use as-is, no lookup
Name not found in fileTell the user; list the available names from the file
File missingShow the structure above and let the user create it, or use the address the user provided
YAML parse errorAsk the user to check the file format

Security

Never read, display, or share the contents of scripts/.env or ~/.wmyskills/.env. They contain SMTP credentials. Use the table below only as a reference for which variables exist — do not read the actual .env files.

VariableDefaultDescription
EMAIL_HOST—SMTP server hostname
EMAIL_PORT465SMTP server port
EMAIL_USER—Sender email address
EMAIL_AUTH—SMTP password / app token
EMAIL_NAMEClaudeCodeSender display name

On Error

If sending fails:

Connection refused / timeout — EMAIL_HOST or EMAIL_PORT may be wrong; check with your provider.

Authentication failed — EMAIL_USER/EMAIL_AUTH may be wrong; some providers require an app-specific password.

smtplib exception — missing or incorrect env vars; SMTP exceptions are not caught and will print a traceback. Check EMAIL_HOST, EMAIL_USER, and EMAIL_AUTH are set correctly.

"file not found" / "attachment not found" — the path to the HTML file or attachment is invalid. Check the path and try again.

Notes

  • Escape sequences (\n, \t, etc.) in --text and --html body arguments are decoded automatically
  • No argparse is used — arguments are positional and order-sensitive
  • The EMAIL_PORT defaults to 465 (SSL); STARTTLS (587) is not supported
  • The --file mode path supports ~ for home directory expansion

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.