Email — AI Sends and Receives Mail
Email — AI Sends and Receives Mail — easy-to-understand guide based on official docs
Think of it like giving your assistant a dedicated inbox—people send mail to it, and it replies on its own. That’s exactly what Hermes Agent can do now. No code, no extra software, just a mailbox and a few minutes of setup.
What It Is
Hermes connects to your email account using standard IMAP and SMTP protocols. When someone sends a message to the agent’s address, the agent reads it and replies within the same email thread. It works just like a normal email account—no special client or third-party service required.
The best part? This feature is built entirely on Python’s standard library. No extra packages, no external dependencies.
How It Differs from the Other Email Skill
Hermes actually has two email capabilities—don’t mix them up:
| Scenario | Setup | What You Need |
|---|---|---|
| Others email the AI, and it auto-replies | Email Gateway Adapter (this page) | Just a mailbox |
| The AI proactively reads, organizes, and sends mail | Himalaya Email Skill | Requires the himalaya CLI tool |
In short: the gateway adapter is passive—it waits for incoming mail. The Himalaya skill is active—the AI manages mail like an operator.
Before You Start: Three Requirements
- A dedicated mailbox—never use your personal one. Create a separate account for the AI.
- Enable IMAP—find this setting in your email provider’s options.
- Get an app password—required for Gmail and most services with two-factor authentication.
Provider-Specific Notes
Gmail users:
- Turn on two-step verification.
- Visit the App Passwords page.
- Create a new password (choose “Mail” or “Other”).
- Copy the 16-character password—this is what you’ll use.
Outlook / Microsoft 365 users:
- IMAP server:
outlook.office365.com - SMTP server:
smtp.office365.com - Enable two-step verification in security settings, then create an app password.
Other providers: Check your provider’s docs. Generally, IMAP uses port 993 (SSL) and SMTP uses port 587 (STARTTLS).
Step 1: Configure Hermes
The easiest way—run one command:
hermes gateway setup
Select Email, then follow the wizard to enter your address, password, IMAP/SMTP servers, and an allowed-senders list (whitelist).
Manual Configuration (Optional)
Prefer editing files? Open ~/.hermes/.env and add something like:
EMAIL_ADDRESS=agent@example.com
EMAIL_PASSWORD=your_app_password
IMAP_HOST=imap.example.com
SMTP_HOST=smtp.example.com
ALLOWED_SENDERS=friend@example.com, boss@company.com
Wrap-Up
Giving your AI an email account is like handing it a personal inbox—people write to it, and it responds automatically. Three steps: prepare a dedicated mailbox, enable IMAP, and run the setup command.
Practical tip: Always set the allowed-senders whitelist! Only trusted people should be able to trigger the AI’s replies—this keeps spam from bothering your agent. When testing for the first time, send a message from your other email account to confirm everything works before opening it up to others.
📖 Official Docs
This article is based on the official Hermes Agent documentation:Official docs › user-guide/messaging/email