Complete Zoho Mail integration with OAuth2, REST API (5-10x faster), Clawdbot /email commands, HTML emails, attachments, and batch operations. Perfect for email automation and workflows.
Instrucciones de origen · Vista previa de solo lectura
name
zoho-email
description
Complete Zoho Mail integration with OAuth2, REST API (5-10x faster), Clawdbot /email commands, HTML emails, attachments, and batch operations. Perfect for email automation and workflows.
v2.1 - Complete Zoho Mail integration with OAuth2 authentication, REST API backend (5-10x faster than IMAP/SMTP), and Clawdbot extension with /email commands for Telegram/Discord. Supports HTML emails, attachments, batch operations, and advanced automation workflows.
Choose your authentication: OAuth2 (recommended, secure) or app password (simple setup).
✨ Features
🔐 Authentication & Performance
OAuth2 authentication - Secure token-based auth with automatic refresh
REST API backend - 5-10x faster operations than IMAP/SMTP
Graceful fallback - Automatically falls back to IMAP if REST API unavailable
App password support - Simple alternative to OAuth2
📧 Email Operations
📥 Read emails - Fetch from any folder (Inbox, Sent, Drafts, etc.)
🔍 Smart search - Search by subject, sender, keywords with REST API speed
📊 Monitor inbox - Real-time unread count for notifications
📤 Send emails - Plain text or HTML with CC/BCC support
🎨 HTML emails - Rich formatting with professional templates included
📎 Attachments - Send and download file attachments
⚡ Batch & Bulk Operations
Batch operations - Mark, delete, or move multiple emails efficiently
Bulk actions - Search and act on hundreds of emails at once
Dry-run mode - Preview actions before executing for safety
🔒 Security
No hardcoded credentials - OAuth2 tokens or environment variables only
Automatic token refresh - Seamless token renewal
Encrypted connections - SSL/TLS for all operations
📦 Installation
clawdhub install zoho-email
Requirements:
Python 3.x
requests library (install: pip3 install requests)
Zoho Mail account
⚙️ Setup
1. Get an App-Specific Password
Important: Don't use your main Zoho password!
Log in to Zoho Mail
Go to Settings → Security → App Passwords
Generate a new app password for "Clawdbot" or "IMAP/SMTP Access"
All commands require credentials set via environment variables.
Quick commands (common tasks)
# Diagnose setup (recommended first step)
python3 scripts/zoho-email.py doctor
# Unread count (great for briefings)
python3 scripts/zoho-email.py unread
# Search inbox
python3 scripts/zoho-email.py search "invoice"# Get a specific email (folder + id)
python3 scripts/zoho-email.py get INBOX <id>
# Send a simple email
python3 scripts/zoho-email.py send recipient@example.com "Subject""Body text"# Empty Spam (safe by default: DRY RUN)
python3 scripts/zoho-email.py empty-spam
# Execute for real
python3 scripts/zoho-email.py empty-spam --execute
# Empty Trash (safe by default: DRY RUN)
python3 scripts/zoho-email.py empty-trash
# Execute for real
python3 scripts/zoho-email.py empty-trash --execute
Send HTML Emails
Send rich, formatted HTML emails with multipart/alternative support (both HTML and plain text versions):
CLI Command:
# Send HTML from a file
python3 scripts/zoho-email.py send-html recipient@example.com "Newsletter" examples/templates/newsletter.html
# Send HTML from inline text
python3 scripts/zoho-email.py send-html recipient@example.com "Welcome""<h1>Hello!</h1><p>Welcome to our service.</p>"# Preview HTML email before sending
python3 scripts/zoho-email.py preview-html examples/templates/newsletter.html
Python API:
from scripts.zoho_email import ZohoEmail
zoho = ZohoEmail()
# Method 1: Send HTML with auto-generated plain text fallback
zoho.send_html_email(
to="recipient@example.com",
subject="Newsletter",
html_body="<h1>Hello!</h1><p>Welcome!</p>"
)
# Method 2: Send HTML with custom plain text version
zoho.send_email(
to="recipient@example.com",
subject="Newsletter",
body="Plain text version of your email",
html_body="<h1>Hello!</h1><p>HTML version of your email</p>"
)
# Load HTML from template filewithopen('examples/templates/newsletter.html', 'r') as f:
html_content = f.read()
zoho.send_html_email(
to="recipient@example.com",
subject="Monthly Newsletter",
html_body=html_content
)