imap-smtp-emailRead 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.
Install via ClawdBot CLI:
clawdbot install gzlicanyi/imap-smtp-emailRead, 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.
Create .env in the skill folder or set environment variables:
# 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.
node scripts/imap.js check [--limit 10] [--mailbox INBOX] [--recent 2h]
Options:
--limit : Max results (default: 10)--mailbox : Mailbox to check (default: INBOX)--recent : Only show emails from last X time (e.g., 30m, 2h, 7d)Fetch full email content by UID.
node scripts/imap.js fetch <uid> [--mailbox INBOX]
Download all attachments from an email, or a specific attachment.
node scripts/imap.js download <uid> [--mailbox INBOX] [--dir <path>] [--file <filename>]
Options:
--mailbox : Mailbox (default: INBOX)--dir : Output directory (default: current directory)--file : Download only the specified attachment (default: download all)Search emails with filters.
node 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.
node scripts/imap.js mark-read <uid> [uid2 uid3...]
node scripts/imap.js mark-unread <uid> [uid2 uid3...]
List all available mailboxes/folders.
node scripts/imap.js list-mailboxes
Send email via SMTP.
node scripts/smtp.js send --to <email> --subject <text> [options]
Required:
--to : Recipient (comma-separated for multiple)--subject : Email subject, or --subject-file Optional:
--body : Plain text body--html: Send body as HTML--body-file : Read body from file--html-file : Read HTML from file--cc : CC recipients--bcc : BCC recipients--attach : Attachments (comma-separated)--from : Override default senderExamples:
# 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.
node scripts/smtp.js test
npm 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=falseGenerated Mar 1, 2026
Automatically check for new customer inquiries via email, categorize them based on subject or sender, and send templated responses or escalate to human agents. This reduces response time and ensures no email is missed, improving customer satisfaction.
Send bulk promotional emails with HTML content and attachments to targeted lists, track unread replies for follow-ups, and manage opt-outs by marking emails as read or archiving. This streamlines outreach efforts and enhances engagement metrics.
Monitor shared inboxes for team notifications, forward important emails to specific members, and send automated reports or alerts via SMTP. This centralizes communication and ensures timely information dissemination across departments.
Search and download emails with attachments for legal or audit purposes, organize them into folders, and mark as read/unread for tracking. This helps maintain records and meet regulatory requirements efficiently.
Check for unread emails periodically, filter spam or low-priority messages, and send reminders or summaries via scheduled emails. This aids individuals in managing inbox overload and staying organized daily.
Offer this skill as part of a subscription-based platform for businesses needing email automation, with tiered pricing based on usage limits or advanced features like attachment handling. Revenue comes from monthly or annual fees.
Provide custom setup, configuration, and integration services for companies to deploy this skill with their existing email servers, including troubleshooting and training. Revenue is generated through project-based fees or hourly rates.
License this skill to other software vendors or agencies who rebrand it as part of their own product offerings, such as CRM or helpdesk tools. Revenue comes from licensing fees or revenue-sharing agreements.
💬 Integration Tip
Ensure environment variables are securely stored in .env files and test connections with the 'test' command before full deployment to avoid authentication issues.
CLI to manage emails via IMAP/SMTP. Use `himalaya` to list, read, write, reply, forward, search, and organize emails from the terminal. Supports multiple accounts and message composition with MML (MIME Meta Language).
Gmail API integration with managed OAuth. Read, send, and manage emails, threads, labels, and drafts. Use this skill when users want to interact with Gmail. For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway).
Automatically logs into email accounts (Gmail, Outlook, QQ Mail, etc.) and generates daily email summaries. Use when the user wants to get a summary of their emails, check important messages, or create daily email digests.
Fetch content from Feishu (Lark) Wiki, Docs, Sheets, and Bitable. Automatically resolves Wiki URLs to real entities and converts content to Markdown.
Manage Feishu (Lark) calendars by listing, searching, checking schedules, syncing events, and marking tasks with automated date extraction.
Set up Gmail API access via gog CLI with manual OAuth flow. Use when setting up Gmail integration, renewing expired OAuth tokens, or troubleshooting Gmail authentication on headless servers.