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 CLI — 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!"

AI integration

Helpers in zohomail.ai make it easy to pipe emails into any LLM without extra dependencies:

import asyncio
from openai import OpenAI
from zohomail import ZohoMailClient
from zohomail.ai import emails_to_messages, email_to_prompt

client = ZohoMailClient(email="you@zoho.com", password="...", region="eu")
emails = asyncio.run(client.list_emails(limit=10))

# Summarise inbox with OpenAI
oai = OpenAI()
resp = oai.chat.completions.create(
    model="gpt-4o-mini",
    messages=emails_to_messages(emails, system="Summarise these emails briefly."),
)
print(resp.choices[0].message.content)

# Draft a reply with Claude
import anthropic
email = asyncio.run(client.read_email(emails[0]["id"]))

ac = anthropic.Anthropic()
msg = ac.messages.create(
    model="claude-sonnet-4-6",
    max_tokens=512,
    messages=[{"role": "user", "content": email_to_prompt(email, "Write a short reply:")}],
)
print(msg.content[0].text)

Available helpers: email_to_text, email_to_prompt, emails_to_messages, email_to_tool_result.

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 — 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.3.tar.gz (12.8 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.3-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: zohomail_free-0.1.3.tar.gz
  • Upload date:
  • Size: 12.8 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.3.tar.gz
Algorithm Hash digest
SHA256 811e6e87e1cf2e143f88b653e2bbcd0dfb9fbba7cdf218f5cc5d417007a173f0
MD5 c86e951b36e7bf99e3e0dcb3998cdbef
BLAKE2b-256 01ed9ad0cbb684b7224bf28aaccb958b10889201532dbb9f37210e431f0a23dd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zohomail_free-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 13.7 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b0b8f6aebc103b52018e919b3e5debf95064420b0ae2d16dbb8c22cae07176e2
MD5 f7c982b9989adda2a6d30dbcb2d36bbd
BLAKE2b-256 ddc196fe44db174ec6d4217f79e82afc90bed37130a14f5027795aeecf28f6b5

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