Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Read and send email via IMAP/SMTP. Check for new/unread messages, fetch content, search mailboxes, mark as read/unread, and send emails with attachments. Works with any IMAP/SMTP server including Gmail, Outlook, 163.com, vip.163.com, 126.com, vip.126.com, 188.com, and vip.188.com.
.claude/skills/kxiandaoyan-imap-smtp-email/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 357% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 472% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 55% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 72% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 108% | 0% |
Read, search, and manage email via IMAP protocol. Send email via SMTP. Supports Gmail, Outlook, 163.com, vip.163.com, 126.com, vip.126.com, 188.com, vip.188.com, and any standard IMAP/SMTP server.
This skill requires the following environment variables to be configured:
IMAP_HOST - IMAP server hostname (e.g., imap.gmail.com)IMAP_PORT - IMAP server port (default: 993)IMAP_USER - Your email addressIMAP_PASS - Your password or app passwordIMAP_TLS - Use TLS/SSL connection (default: true)IMAP_REJECT_UNAUTHORIZED - Verify SSL certificates (default: true, set to false for self-signed certs)IMAP_MAILBOX - Default mailbox (default: INBOX)SMTP_HOST - SMTP server hostname (e.g., smtp.gmail.com)SMTP_PORT - SMTP server port (587 for STARTTLS, 465 for SSL)SMTP_SECURE - Use SSL (true for port 465, false for port 587)SMTP_USER - Your email addressSMTP_PASS - Your password or app passwordSMTP_FROM - Default sender email (optional)SMTP_REJECT_UNAUTHORIZED - Verify SSL certificates (default: true, set to false for self-signed certs).env file (add to .gitignore)npm install in the skill directory to install dependenciesCreate .env in the skill folder or set environment variables:
bash# IMAP Configuration (receiving email) IMAP_HOST=imap.gmail.com # Server hostname IMAP_PORT=993 # Server port IMAP_USER=your@email.com IMAP_PASS=your_password IMAP_TLS=true # Use TLS/SSL connection IMAP_REJECT_UNAUTHORIZED=true # Set to false for self-signed certs IMAP_MAILBOX=INBOX # Default mailbox # SMTP Configuration (sending email) SMTP_HOST=smtp.gmail.com # SMTP server hostname SMTP_PORT=587 # SMTP port (587 for STARTTLS, 465 for SSL) SMTP_SECURE=false # true for SSL (465), false for STARTTLS (587) SMTP_USER=your@gmail.com # Your email address SMTP_PASS=your_password # Your password or app password SMTP_FROM=your@gmail.com # Default sender email (optional) SMTP_REJECT_UNAUTHORIZED=true # Set to false for self-signed certs
| Provider | IMAP Host | IMAP Port | SMTP Host | SMTP Port | |----------|-----------|-----------|-----------|-----------| | 163.com | imap.163.com | 993 | smtp.163.com | 465 | | vip.163.com | imap.vip.163.com | 993 | smtp.vip.163.com | 465 | | 126.com | imap.126.com | 993 | smtp.126.com | 465 | | vip.126.com | imap.vip.126.com | 993 | smtp.vip.126.com | 465 | | 188.com | imap.188.com | 993 | smtp.188.com | 465 | | vip.188.com | imap.vip.188.com | 993 | smtp.vip.188.com | 465 | | yeah.net | imap.yeah.net | 993 | smtp.yeah.net | 465 | | Gmail | imap.gmail.com | 993 | smtp.gmail.com | 587 | | Outlook | outlook.office365.com | 993 | smtp.office365.com | 587 | | QQ Mail | imap.qq.com | 993 | smtp.qq.com | 587 |
Important for 163.com:
Check for new/unread emails.
bashnode scripts/imap.js check [--limit 10] [--mailbox INBOX] [--recent 2h]
Options:
--limit <n>: Max results (default: 10)--mailbox <name>: Mailbox to check (default: INBOX)--recent <time>: Only show emails from last X time (e.g., 30m, 2h, 7d)Fetch full email content by UID.
bashnode scripts/imap.js fetch <uid> [--mailbox INBOX]
Download all attachments from an email, or a specific attachment.
bashnode scripts/imap.js download <uid> [--mailbox INBOX] [--dir <path>] [--file <filename>]
Options:
--mailbox <name>: Mailbox (default: INBOX)--dir <path>: Output directory (default: current directory)--file <filename>: Download only the specified attachment (default: download all)Search emails with filters.
bashnode scripts/imap.js search [options] Options: --unseen Only unread messages --seen Only read messages --from <email> From address contains --subject <text> Subject contains --recent <time> From last X time (e.g., 30m, 2h, 7d) --since <date> After date (YYYY-MM-DD) --before <date> Before date (YYYY-MM-DD) --limit <n> Max results (default: 20) --mailbox <name> Mailbox to search (default: INBOX)
Mark message(s) as read or unread.
bashnode scripts/imap.js mark-read <uid> [uid2 uid3...] node scripts/imap.js mark-unread <uid> [uid2 uid3...]
List all available mailboxes/folders.
bashnode scripts/imap.js list-mailboxes
Send email via SMTP.
bashnode scripts/smtp.js send --to <email> --subject <text> [options]
Required:
--to <email>: Recipient (comma-separated for multiple)--subject <text>: Email subject, or --subject-file <file>Optional:
--body <text>: Plain text body--html: Send body as HTML--body-file <file>: Read body from file--html-file <file>: Read HTML from file--cc <email>: CC recipients--bcc <email>: BCC recipients--attach <file>: Attachments (comma-separated)--from <email>: Override default senderExamples:
bash# Simple text email node scripts/smtp.js send --to recipient@example.com --subject "Hello" --body "World" # HTML email node scripts/smtp.js send --to recipient@example.com --subject "Newsletter" --html --body "<h1>Welcome</h1>" # Email with attachment node scripts/smtp.js send --to recipient@example.com --subject "Report" --body "Please find attached" --attach report.pdf # Multiple recipients node scripts/smtp.js send --to "a@example.com,b@example.com" --cc "c@example.com" --subject "Update" --body "Team update"
Test SMTP connection by sending a test email to yourself.
bashnode scripts/smtp.js test
bashnpm install
.env (add to .gitignore)Connection timeout:
Authentication failed:
TLS/SSL errors:
IMAP_TLS/SMTP_SECURE setting to server requirementsIMAP_REJECT_UNAUTHORIZED=false or SMTP_REJECT_UNAUTHORIZED=false| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-02 | fail→fail | 5,570 | 6,441 | +16% | 1 | 1 | 0% | 959 | 2,830 | +195% | 0 | 0 | — |
case-01 | fail→pass | 3,902 | 16,677 | +327% | 1 | 1 | 0% | 559 | 2,557 | +357% | 0 | 0 | — |
case-03 | fail→fail | 9,566 | 5,691 | -41% | 1 | 1 | 0% | 1,863 | 2,546 | +37% | 0 | 0 | — |
case-04 | fail→pass | 2,683 | 3,908 | +46% | 1 | 1 | 0% | 426 | 2,438 | +472% | 0 | 0 | — |
case-05 | fail→pass | 9,377 | 1,981 | -79% | 1 | 1 | 0% | 1,635 | 2,532 | +55% | 0 | 0 | — |
case-06 | fail→fail | 29,561 | 6,435 | -78% | 1 | 1 | 0% | 6,158 | 2,892 | -53% | 0 | 0 | — |
case-07 | fail→fail | 8,647 | 4,361 | -50% | 1 | 1 | 0% | 1,462 | 2,883 | +97% | 0 | 0 | — |
case-08 | fail→pass | 8,551 | 1,544 | -82% | 1 | 1 | 0% | 1,419 | 2,437 | +72% | 0 | 0 | — |
case-09 | fail→pass | 6,876 | 1,731 | -75% | 1 | 1 | 0% | 1,198 | 2,491 | +108% | 0 | 0 | — |
case-10 | fail→pass | 6,905 | 5,440 | -21% | 1 | 1 | 0% | 1,213 | 2,684 | +121% | 0 | 0 | — |
case-11 | fail→pass | 8,587 | 2,323 | -73% | 1 | 1 | 0% | 1,610 | 2,619 | +63% | 0 | 0 | — |
case-12 | fail→pass | 2,592 | 5,407 | +109% | 1 | 1 | 0% | 349 | 3,125 | +795% | 0 | 0 | — |
case-13 | fail→pass | 9,461 | 1,455 | -85% | 1 | 1 | 0% | 1,691 | 2,415 | +43% | 0 | 0 | — |
case-14 | pass→pass | 8,009 | 3,390 | -58% | 1 | 1 | 0% | 1,481 | 2,838 | +92% | 0 | 0 | — |
case-15 | pass→pass | 6,082 | 1,914 | -69% | 1 | 1 | 0% | 1,034 | 2,540 | +146% | 0 | 0 | — |
case-16 | pass→pass | 8,164 | 1,900 | -77% | 1 | 1 | 0% | 1,475 | 2,533 | +72% | 0 | 0 | — |
case-17 | fail→pass | 10,380 | 2,785 | -73% | 1 | 1 | 0% | 1,829 | 2,736 | +50% | 0 | 0 | — |
case-18 | fail→pass | 7,506 | 2,692 | -64% | 1 | 1 | 0% | 537 | 2,512 | +368% | 0 | 0 | — |
case-19 | fail→pass | 4,707 | 1,834 | -61% | 1 | 1 | 0% | 715 | 2,513 | +251% | 0 | 0 | — |
case-20 | fail→pass | 11,435 | 8,318 | -27% | 1 | 1 | 0% | 1,994 | 3,624 | +82% | 0 | 0 | — |
case-21 | fail→fail | 19,879 | 12,711 | -36% | 1 | 1 | 0% | 3,799 | 4,699 | +24% | 0 | 0 | — |
case-22 | fail→fail | 16,272 | 11,852 | -27% | 1 | 1 | 0% | 3,070 | 4,383 | +43% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 19 counted toward the lift figure. The other 3 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +59 percentage points is the difference between those two pass rates over the 19 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.