Skip to main content

Read, send, and reply to Zoho Mail emails on free-tier accounts — no IMAP or POP3 needed

Project description

zohomail-free

PyPI version Python 3.11+ License: MIT

Built by MelkonTech
Documentation · PyPI · GitHub

Read, send, and reply to Zoho Mail emails from Python or the command line — on a free account.

Zoho locks IMAP/POP3 behind paid plans, so standard email libraries don't work on free accounts. zohomail-free works around this by authenticating via the Zoho web UI and calling their internal API directly — giving you full inbox access and SMTP sending without paying for a plan.

Install

pip install zohomail-free
playwright install chromium

Setup

Create a .env file with your credentials:

ZOHO_EMAIL=you@yourdomain.com
ZOHO_PASSWORD=your_zoho_login_password
ZOHO_APP_PASSWORD=your_app_specific_password   # for sending
ZOHO_REGION=eu   # eu or com

Generate an app-specific password in Zoho Mail → Settings → Security → App Passwords.

Python

import asyncio
from zohomail import ZohoMailClient, send

client = ZohoMailClient(
    email="you@yourdomain.com",
    password="your_password",
    region="eu",
)

# List inbox
emails = asyncio.run(client.list_emails(limit=5))
for e in emails:
    print(e["subject"], "—", e["from"])

# Read a full email
email = asyncio.run(client.read_email(emails[0]["id"]))
print(email["body"])

# Send an email
send(
    from_addr="you@yourdomain.com",
    app_password="your_app_password",
    to="friend@example.com",
    subject="Hello",
    body="Hi there!",
    region="eu",
)

CLI

# List inbox
zohomail list
zohomail list --limit 20 --json

# Read a message (get the id from list output)
zohomail read --id 1782000221530004400

# Send a new email
zohomail send --to someone@example.com --subject "Hello" --body "Hi there"

# Reply to an email (preserves threading)
zohomail reply --id 1782000221530004400 --body "Thanks!"

Self-hosted REST API

Run a local API server over your Zoho account:

# Set API_KEY in your .env, then:
zohomail-api

# Or with Docker
docker build -t zohomail-free .
docker run -p 8000:8000 --env-file .env zohomail-free
Method Path Description
GET /emails List inbox (?limit=10)
GET /emails/{id} Read full email
POST /emails/send Send new email
POST /emails/{id}/reply Reply to email
GET /health Health check

All endpoints require X-API-Key: <your_key> header.

curl -H "X-API-Key: your_key" http://localhost:8000/emails

How it works

Zoho's free plan blocks IMAP/POP3 with ACCESS_RESTRICTED_BY_ZOHOMAIL. However, their web UI talks to an internal JSON API (ml.do / md.do) over HTTPS. This library uses Playwright to authenticate once, saves the session cookie at ~/.zohomail_session.pkl, then makes API calls from within the browser context where cookies are correctly scoped — no paid plan needed.

On subsequent runs the saved session is reused. If it expires, the library re-authenticates automatically.

Documentation

Full docs at melkontech.github.io/zohomail-free

Author

Built by MelkonTech

License

MIT — see LICENSE

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zohomail_free-0.1.2.tar.gz (12.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zohomail_free-0.1.2-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

Details for the file zohomail_free-0.1.2.tar.gz.

File metadata

  • Download URL: zohomail_free-0.1.2.tar.gz
  • Upload date:
  • Size: 12.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for zohomail_free-0.1.2.tar.gz
Algorithm Hash digest
SHA256 f3753c72b015909a6073a3fe04b5da08f10c7486b731d26aed5369c7593c4f10
MD5 d4f1344b5fb11163c752788d881e1427
BLAKE2b-256 b79710039e6a93cd8d7dc6b68a68c91ff877954e3ad7030284f9ee8702a3c584

See more details on using hashes here.

File details

Details for the file zohomail_free-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: zohomail_free-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 14.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for zohomail_free-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4d129e6480ab52780c07d1bb9cc87190c40dd48943974d98804b1e79b275a7c4
MD5 9f57202b8acb5e15f1a7134c440bccc0
BLAKE2b-256 94060b043d12c82dc25273efcc93b95c861c9807692b5bd50fe2368f6bfff0ef

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page