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

Built by MelkonTech
Documentation · PyPI · GitHub

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

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

Install

pip install zohomail-free
playwright install chromium

Setup

Copy .env.example to .env and fill in 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.

CLI

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

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

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

# reply to an email
zohomail reply --id 1782000221530004400 --body "Thanks!"

Python

import asyncio
from zohomail.client import ZohoMailClient

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 full email
email = asyncio.run(client.read_email(emails[0]["id"]))
print(email["body"])

Self-hosted API

cp .env.example .env   # fill in credentials + set a strong API_KEY

# with Docker
docker build -t zohomail-free .
docker run -p 8000:8000 --env-file .env zohomail-free

# or directly
pip install git+https://github.com/MelkonTech/zohomail-free.git
zohomail-api

Endpoints

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 (set API_KEY in .env).

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

Deploy to Railway

  1. Fork this repo on GitHub
  2. Go to railway.app → New Project → Deploy from GitHub repo
  3. Select your fork
  4. Add environment variables from .env.example in Railway's Variables tab
  5. Deploy — Railway auto-detects the Dockerfile

How it works

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

Session cookies are cached at ~/.zohomail_session.pkl and reused on subsequent runs. If the session expires, the library automatically re-authenticates.

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.1.tar.gz (13.0 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.1-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: zohomail_free-0.1.1.tar.gz
  • Upload date:
  • Size: 13.0 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.1.tar.gz
Algorithm Hash digest
SHA256 609eacc4d7ae8dc0cba9d06343e4faa7d4b25a54f4d799b204265399baf6b808
MD5 9fb91e6344559733c83257b84c78faed
BLAKE2b-256 aef8f05621a1d35a52166a034be54489b0fab7b11780a60b428987ea6f781aab

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zohomail_free-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 14.2 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 842772c6d7f25a38413844fd418f90953ae6f3b7e0f3418b336ccf7b53524d5a
MD5 b2e3f4c0797601b438795f7da145a35f
BLAKE2b-256 1b1e4f74d5eb9a0d71294a7ff02b6a46f5b4db8078e78a8d890e9c67c8fe667e

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