Email Integration
Otto supports both outbound and inbound email. The agent can send emails as part of task execution, and Otto can monitor an inbox to automatically create tasks from incoming messages.
Otto supports both outbound and inbound email. The agent can send emails as part of task execution, and Otto can monitor an inbox to automatically create tasks from incoming messages.
Outbound Email (SMTP)
Otto's agent has a built-in send_email tool that sends emails through your SMTP server. When a task requires sending an email -- drafting a follow-up, sending a report, notifying a contact -- Otto composes and sends it directly.
Capabilities
- Send to one or multiple recipients (comma-separated)
- CC recipients
- HTML email body
- File attachments from the agent's sandbox storage (up to 10 MB per file)
- Automatic retry logic (3 attempts with a 5-second delay between retries)
SMTP Configuration
| Variable | Required | Default | Description |
|---|---|---|---|
SMTP_HOST | Yes | -- | SMTP server hostname |
SMTP_PORT | Yes | 465 | SMTP server port (SSL) |
SMTP_USER | Yes | -- | SMTP username (usually the full email address) |
SMTP_PASS | Yes | -- | SMTP password or app-specific password |
Otto connects using SMTP_SSL, so your SMTP server must support SSL on the configured port.
Example: Gmail
For Gmail, you need to generate an App Password if you have 2-factor authentication enabled. Regular account passwords will not work.
Example: Microsoft 365 / Outlook
Note: Microsoft 365 may require enabling SMTP AUTH for the mailbox in the Exchange admin center.
How the Agent Uses Email
When a user asks Otto to send an email, the agent calls the send_email tool with these parameters:
| Parameter | Type | Description |
|---|---|---|
to | string | Comma-separated recipient addresses |
subject | string | Email subject line |
body | string | Email body (HTML supported) |
cc | string (optional) | Comma-separated CC addresses |
attachment_filenames | list (optional) | Files from the sandbox to attach |
Example task: "Email the quarterly report to alice@example.com with the spreadsheet attached."
Otto will draft the email, attach any relevant files from its sandbox, and send it via SMTP.
Inbound Email Monitoring (IMAP)
Otto can monitor an email inbox for incoming tasks. A background thread polls the configured IMAP mailbox at regular intervals and converts qualifying emails into Otto tasks.
How It Works
- Otto connects to the IMAP server over SSL and checks for unread messages.
- Only emails with the exact subject line "New Task" are processed. All other emails are ignored.
- The email sender is matched to an existing Otto user by email address.
- The email body becomes the task description.
- The email is marked as read after processing.
If the sender's email address does not match any user in Otto's database, the email is skipped.
IMAP Configuration
| Variable | Required | Default | Description |
|---|---|---|---|
IMAP_HOST | Yes | -- | IMAP server hostname |
IMAP_PORT | No | 993 | IMAP server port (SSL) |
SMTP_USER | Yes | -- | Login username for IMAP (reuses the SMTP credential) |
SMTP_PASS | Yes | -- | Login password for IMAP (reuses the SMTP credential) |
IMAP_CHECK | No | 60 | Polling interval in seconds |
The IMAP monitor reuses SMTP_USER and SMTP_PASS for authentication. The same email account is used for both sending and receiving.
Example: Gmail
For Gmail, IMAP access must be enabled in your Google account settings, and an App Password is required if 2FA is active.
Example: Microsoft 365 / Outlook
Startup Behavior
The email monitor starts automatically when the backend boots, provided IMAP_HOST, SMTP_USER, and SMTP_PASS are all set. If any of these are missing, the monitor is skipped with a log message.
Full Email Configuration Example
To enable both sending and receiving:
Troubleshooting
Outbound emails are not being sent
- Check that all four SMTP variables are set (
SMTP_HOST,SMTP_PORT,SMTP_USER,SMTP_PASS). - Verify the credentials work by testing with a standard email client.
- For Gmail, ensure you are using an App Password, not your regular password.
- For Microsoft 365, confirm that SMTP AUTH is enabled for the mailbox.
- The
send_emailtool retries 3 times with a 5-second delay. Check the backend logs for error details.
Inbound emails are not creating tasks
- The email subject must be exactly "New Task" (case-insensitive). Emails with any other subject are intentionally ignored.
- The sender's email address must match an existing user in Otto's database. Unrecognized senders are skipped.
- Verify IMAP credentials by connecting with a mail client.
- Check the backend logs for
[Email Monitor]entries to see polling activity and any errors.
Authentication failures
- Gmail: Enable "Less secure app access" or use an App Password. IMAP must be turned on in Gmail settings.
- Outlook/Microsoft 365: Modern Auth (OAuth 2.0) is increasingly required. App Passwords or SMTP AUTH enablement may be necessary depending on your tenant configuration.