Otto Docs
Integrations

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

VariableRequiredDefaultDescription
SMTP_HOSTYes--SMTP server hostname
SMTP_PORTYes465SMTP server port (SSL)
SMTP_USERYes--SMTP username (usually the full email address)
SMTP_PASSYes--SMTP password or app-specific password

Otto connects using SMTP_SSL, so your SMTP server must support SSL on the configured port.

Example: Gmail

SMTP_HOST=smtp.gmail.com
SMTP_PORT=465
SMTP_USER=otto@yourcompany.com
SMTP_PASS=your-app-password

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

SMTP_HOST=smtp.office365.com
SMTP_PORT=587
SMTP_USER=otto@yourcompany.com
SMTP_PASS=your-password

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:

ParameterTypeDescription
tostringComma-separated recipient addresses
subjectstringEmail subject line
bodystringEmail body (HTML supported)
ccstring (optional)Comma-separated CC addresses
attachment_filenameslist (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

  1. Otto connects to the IMAP server over SSL and checks for unread messages.
  2. Only emails with the exact subject line "New Task" are processed. All other emails are ignored.
  3. The email sender is matched to an existing Otto user by email address.
  4. The email body becomes the task description.
  5. 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

VariableRequiredDefaultDescription
IMAP_HOSTYes--IMAP server hostname
IMAP_PORTNo993IMAP server port (SSL)
SMTP_USERYes--Login username for IMAP (reuses the SMTP credential)
SMTP_PASSYes--Login password for IMAP (reuses the SMTP credential)
IMAP_CHECKNo60Polling 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

IMAP_HOST=imap.gmail.com
IMAP_PORT=993
SMTP_USER=otto@yourcompany.com
SMTP_PASS=your-app-password
IMAP_CHECK=30

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

IMAP_HOST=outlook.office365.com
IMAP_PORT=993
SMTP_USER=otto@yourcompany.com
SMTP_PASS=your-password
IMAP_CHECK=30

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:

# Outbound (SMTP)
SMTP_HOST=smtp.gmail.com
SMTP_PORT=465
SMTP_USER=otto@yourcompany.com
SMTP_PASS=your-app-password
 
# Inbound (IMAP)
IMAP_HOST=imap.gmail.com
IMAP_PORT=993
IMAP_CHECK=30

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_email tool 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.