This sends email via SMTP with optional file attachments and can sync sent messages to an IMAP folder so they show up in your "Sent Items" across mail clients. You configure credentials through environment variables, then call a Python script to send messages with flags for recipients, subject, body, and local file paths. The sent-sync feature is the interesting bit here: it appends your outbound message to IMAP after SMTP delivery, which matters if you're automating email from a service account but want a proper audit trail. Returns structured JSON for success and errors. It's straightforward plumbing for when you need programmatic email that behaves like a normal mail client.
npx -y skills add tiangong-ai/skills --skill email-smtp-send --agent claude-codeInstalls into .claude/skills of the current project.
references/env.md and assets/config.example.env).imapclient when sync is enabled.python3 scripts/smtp_send.py check-config
python3 scripts/smtp_send.py send \
--to recipient@example.com \
--subject "SMTP test" \
--body "Hello from email-smtp-send"
python3 scripts/smtp_send.py send \
--to recipient@example.com \
--subject "Package delivery" \
--body "See attachments." \
--attach ./report.pdf \
--attach ./appendix.xlsx
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"
check-config prints sanitized SMTP config + defaults + sent-sync config JSON.send success prints one type=status JSON object containing:
event=smtp_sentmessage_idattachment_count and attachments[] metadatasent_sync object with enabled, required, appended, and sync metadata/errorsend failures print type=error JSON to stderr with one of:
event=smtp_send_invalid_argsevent=smtp_send_failedevent=smtp_sent_sync_failed (only when sync is required and sync fails)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_STARTTLSSMTP_USERNAME, SMTP_PASSWORD, SMTP_FROM, SMTP_CONNECT_TIMEOUTSMTP_SUBJECT, SMTP_BODY, SMTP_CONTENT_TYPESMTP_MAX_ATTACHMENT_BYTESSMTP_SYNC_SENT, SMTP_SYNC_SENT_REQUIREDSMTP_SENT_IMAP_HOST, SMTP_SENT_IMAP_PORT, SMTP_SENT_IMAP_SSLSMTP_SENT_IMAP_USERNAME, SMTP_SENT_IMAP_PASSWORDSMTP_SENT_IMAP_MAILBOX, SMTP_SENT_IMAP_FLAGS, SMTP_SENT_IMAP_CONNECT_TIMEOUTIMAP_HOST, IMAP_PORT, IMAP_SSL, IMAP_USERNAME, IMAP_PASSWORD, IMAP_CONNECT_TIMEOUTimapclient:python3 -m pip install imapclient
2.1.--sent-sync-required or SMTP_SYNC_SENT_REQUIRED=true), sync failure exits with code 1.references/env.mdassets/config.example.envscripts/smtp_send.pyjuliusbrussee/caveman
mattpocock/skills
shadcn/improve
obra/superpowers
forrestchang/andrej-karpathy-skills
vercel-labs/skills