email-smtp-send — скилл для Claude Code: что делает и как установить
Отправляет письма через SMTP с локальными вложениями и сохраняет копию в папку «Отправленные» через IMAP. Пригодится агенту для надёжной почтовой рассылки и отчётов.
npx skills add tiangong-ai/agent-skills --skill email-smtp-send -a claude-codeЧто делает email-smtp-send
Скилл запускает скрипт scripts/smtp_send.py для отправки писем через SMTP. Параметры подключения берутся из переменных окружения или аргументов вызова. Поддерживаются вложения любых локальных файлов, форматы plain и html, а также скрытые копии и служебные заголовки In-Reply-To. Ответы и ошибки скрипт возвращает в JSON.
Если нужно, чтобы отправленное письмо отобразилось в почтовом клиенте, скрипт синхронизирует его с ящиком через IMAP APPEND. Для этого режима требуется отдельно установить библиотеку imapclient. При флаге --sent-sync-required сбой синхронизации завершит работу с кодом 1, даже если само письмо ушло получателю. Проверить настройки перед отправкой можно командой check-config.
Какие задачи решает
- отправить отчёт или файл вложения по протоколу SMTP
- проверить конфигурацию SMTP-сервера перед отправкой сообщений
- скопировать отправленное сообщение в папку «Отправленные» через IMAP
- сформировать email в формате HTML со скрытыми копиями
Примеры запросов агенту
- Отправь файл ./report.pdf на [email protected] с темой "Отчёт за неделю" через email-smtp-send
- Проверь настройки SMTP с помощью check-config
- Отправь письмо на [email protected] и сохрани его в Sent Items через IMAP
Как установить email-smtp-send
1Через Skills CLI (Vercel)
npx skills add tiangong-ai/agent-skills --skill email-smtp-send -a claude-code2Вручную: положить файлы
~/.claude/skills/email-smtp-send/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/email-smtp-send/
1Через Skills CLI (Vercel)
npx skills add tiangong-ai/agent-skills --skill email-smtp-send -a codex2Вручную: положить файлы
.agents/skills/email-smtp-send/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add tiangong-ai/agent-skills --skill email-smtp-send -a cursor2Вручную: положить файлы
.cursor/skills/email-smtp-send/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install tiangong-ai/agent-skills email-smtp-send2Вручную: положить файлы
.github/skills/email-smtp-send/SKILL.md1Через Skills CLI (Vercel)
npx skills add tiangong-ai/agent-skills --skill email-smtp-send -a gemini-cli2Командой платформы
gemini skills install https://github.com/tiangong-ai/agent-skills --path email-smtp-sendВручную: положить файлы
.devin/skills/email-smtp-send/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add tiangong-ai/agent-skills --skill email-smtp-send -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о email-smtp-send
Как установить email-smtp-send в Claude Code?
Выполните команду npx skills add tiangong-ai/agent-skills --skill email-smtp-send -a claude-code.
Что делает скилл email-smtp-send?
Он отправляет электронные письма через SMTP-сервер с поддержкой локальных вложений и опциональной синхронизацией с папкой отправленных через IMAP.
Что нужно установить для синхронизации отправленных писем через IMAP?
Потребуется установить библиотеку через python3 -m pip install imapclient и задать параметры IMAP в переменных окружения.
Исходный текст
SKILL.md · MIT
--- name: email-smtp-send description: Send emails through SMTP with optional local attachments and optional IMAP APPEND sync to Sent mailbox. Use when tasks need reliable outbound email delivery, attachment sending, SMTP connectivity checks, or cross-client sent-mail visibility (for example appending to "Sent Items" after SMTP send). --- # 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: ```bash python3 scripts/smtp_send.py check-config ``` 4. Send one email: ```bash python3 scripts/smtp_send.py send \ --to [email protected] \ --subject "SMTP test" \ --body "Hello from email-smtp-send" ``` 5. Send with attachments: ```bash python3 scripts/smtp_send.py send \ --to [email protected] \ --subject "Package delivery" \ --body "See attachments." \ --attach ./report.pdf \ --attach ./appendix.xlsx ``` 6. Send and sync to sent mailbox: ```bash python3 scripts/smtp_send.py send \ --to [email protected] \ --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`: ```bash 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`
© tiangong-ai · MIT · tiangong-ai/agent-skills