Receive Emails
Check your inbox with one line. Process emails safely. Keep it simple.
Quick Start
10 secondsquickstart.py
That's it. You have your emails.
Core Concept
Three functions. That's all:
core.py
Important: Emails are NOT auto-marked as read. You control when to mark them.
Setup
Set your email credentials:
Terminal
$export EMAIL_ADDRESS="you@example.com"
$export EMAIL_PASSWORD="your-app-password"
$export IMAP_SERVER="imap.gmail.com" # Optional, defaults to Gmail
Gmail users: Use an App Password, not your regular password.
Common Patterns
Check for new emails
check_new.py
Get latest email
latest.py
Reply to emails
reply.py
API Reference
get_emails(last=10, unread=False)
Fetch emails from your inbox.
last - Number of emails to fetch (default: 10)
unread - Only fetch unread emails (default: False)
Returns list of email dicts with: id, from, subject, date, body
mark_read(email_id)
Mark an email as read.
email_id - The email ID from get_emails()
mark_unread(email_id)
Mark an email as unread.
email_id - The email ID from get_emails()
Email Agent Example
email_agent.py
get_emails vs Gmail
get_emails (IMAP)
- Simple functions
- Works with any email provider
- Uses EMAIL_PASSWORD env var
- Basic read/mark operations
- Best for simple automation
Gmail (OAuth)
- Full Gmail class with many methods
- Gmail-specific features (labels, archive, star)
- Uses
co auth google - Search, CRM, contact analysis
- Best for advanced Gmail automation
Need more features? Check out Gmail for full inbox management.
