Receive Emails
Check your inbox with one line. Process emails safely. Keep it simple.
Usage
Option 1: Import directly
Option 2: Copy and customize
Quick Start
10 secondsThat's it. You have your emails.
Core Concept
Three functions. That's all:
Important: Emails are NOT auto-marked as read. You control when to mark them.
Setup
No configuration needed. Your agent's email is provisioned automatically:
Your agent receives emails at 0x{your_key}@mail.openonion.ai, stored in ~/.co/keys.env as AGENT_EMAIL.
Common Patterns
Check for new emails
Get latest email
Reply to emails
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:
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
Why No Auto-Mark?
The problem with auto-marking
Our safe approach
Need full Gmail features (labels, search, CRM)? Check out Gmail.
Philosophy
Three functions for everything email:
get_emails()- Read emailssend_email()- Send emailsmark_read()- Mark as processed
No complexity. No confusion. Just email.
Keep simple things simple.
ConnectOnion