Skip to main content
connic

Email (SMTP/IMAP)

Run an agent on every new email in an IMAP mailbox, attachments included, and send its replies over SMTP from your own address.

Modes
Inbound, Outbound
Set up in
Dashboard or connectors/*.yaml
Publisher
By connic

Every new email starts a run

connic checks the mailbox over IMAP and gives each new message to every linked agent as structured fields.

Parsed fields
Sender, subject, Message-ID, text and HTML bodies and attachments arrive as separate fields.
Filters before the run
Watch one folder, INBOX by default, and narrow it to unread mail, a sender address or domain, or text in the subject. Mail that doesn't match starts no run.
Read flags
connic marks each message as read once its runs are queued, so your mail client shows what the agent has picked up. Turn it off to leave the flags alone.
email-payload.json
{
  "from": "Jana Weber <jana@example.com>",
  "from_address": "jana@example.com",
  "to": "support@example.com",
  "subject": "Order ord_8812 arrived damaged",
  "date": "Tue, 13 Oct 2026 09:12:04 +0200",
  "message_id": "<c41f9a@mail.example.com>",
  "body_text": "Hi, the lamp in my order arrived broken.",
  "body_html": "<p>Hi, the lamp in my order arrived broken.</p>",
  "has_attachments": true,
  "attachments": [
    {
      "filename": "lamp.jpg",
      "content_type": "image/jpeg",
      "size_bytes": 182044,
      "content": "/9j/4AAQSkZJRgABAQ...",
      "encoding": "base64"
    }
  ],
  "_email": {
    "connector_id": "550e8400-e29b-41d4-a716-446655440000",
    "mailbox": "INBOX",
    "uid": "4127",
    "timestamp": "2026-10-13T07:12:31.204518"
  }
}

Attachments arrive ready to read

Supported attachments come with their content, so the agent can work with the PDF or photo in the same run.

Up to 10 files
Each email carries up to 10 supported attachments, with 10 MiB per file and 10 MiB combined. Text formats arrive as text, everything else as base64.
Supported formats
Images, PDFs, plain text, CSV, Markdown, JSON, XML, HTML, and Word, Excel and PowerPoint files.
Skipped files
Tracking pixels, favicons and signature images are dropped. Any other skipped attachment stays in the list with content set to null and the reason in file_issues, and the email still reaches the agent.
payload["attachments"]
[
  {
    "filename": "invoice-2041.pdf",
    "content_type": "application/pdf",
    "size_bytes": 48213,
    "content": "JVBERi0xLjcKJeLjz9MK...",
    "encoding": "base64"
  },
  {
    "filename": "delivery-note.csv",
    "content_type": "text/csv",
    "size_bytes": 25,
    "content": "sku,qty\nLMP-20,1\nLMP-21,2",
    "encoding": "text"
  },
  {
    "filename": "budget.numbers",
    "content_type": "application/octet-stream",
    "size_bytes": 96512,
    "content": null,
    "content_omitted": true,
    "file_issue": {
      "code": "unsupported_file_type",
      "message": "File type is not supported.",
      "retryable": false,
      "name": "budget.numbers",
      "size_bytes": 96512
    }
  }
]

Keep the mailbox next to your agents

Declare the connector in connectors/. The IMAP and SMTP credentials live in a Connection that the file names, so passwords stay out of your code and each environment can use its own mailbox.

connectors/support-inbox.yaml
type: email
mode: inbound
name: Support inbox
connection: support-mailbox
config:
  mailbox: Support
agents:
  - support-triage
environments:
  Staging:
    connection: support-mailbox-staging
  Production: {}
create: connectors/support-inbox.yaml (email)

Send replies from your own address

An outbound Email connector turns the agent's output into an email, sends it through the SMTP server in your Connection and retries when a send fails.

Replies find the sender
Without a to field, connic uses the connector's default recipient, then the sender of the email that started the run. Without a subject, the reply reuses the original one with Re: in front.
Text or JSON
Plain output becomes the body. JSON can set to, cc, bcc, subject, html_body and reply_to. Send after every run, as a tool the model calls, or from middleware.
Private mail servers
Route IMAP and SMTP traffic through a bridge when the mail server is only reachable inside your network.
output.json
{
  "body": "Sorry about the lamp, Jana. A replacement ships today."
}
sent.eml
From: Example Support <support@example.com>
To: jana@example.com
Subject: Re: Order ord_8812 arrived damaged

Sorry about the lamp, Jana. A replacement ships today.

Where email fits

Pick a setup to see what arrives, which agent runs and what goes out.

Customers write to your support address, and the agent's answer goes back to them over SMTP.

Support mailbox
Inbound email
support-triage
Reply to the sender
email-payload.json
{
  "from_address": "sam@example.com",
  "subject": "Change delivery address for ord_9035",
  "body_text": "Please ship it to my office instead.",
  "has_attachments": false,
  "attachments": []
}
reply.eml
From: Example Support <support@example.com>
To: sam@example.com
Subject: Re: Change delivery address for ord_9035

Done. Order ord_9035 now ships to your office.

Suppliers email PDF invoices, and accounts payable gets the extracted totals by email.

Supplier invoices
Inbound email
invoice-extractor
Summary to accounts payable
email-payload.json
{
  "from_address": "billing@supplier.example",
  "subject": "Invoice INV-2041",
  "has_attachments": true,
  "attachments": [
    {
      "filename": "INV-2041.pdf",
      "content_type": "application/pdf",
      "size_bytes": 48213,
      "content": "JVBERi0xLjcKJeLjz9MK...",
      "encoding": "base64"
    }
  ]
}
output.json
{
  "to": "ap@example.com",
  "subject": "INV-2041: 3 items, EUR 1,284.50",
  "body": "Due Nov 12. Line items and VAT add up to the total."
}

The agent handles routine requests and calls an email tool to hand the rest to your team.

Shared inbox
Inbound email
support-agent
Handoff to your team
email-payload.json
{
  "from_address": "lea@example.com",
  "subject": "Refund for a cancelled booking",
  "body_text": "I cancelled booking B-5521 within 24 hours.",
  "has_attachments": false,
  "attachments": []
}
tool-call.json
{
  "to": "support-leads@example.com",
  "subject": "Refund decision needed: booking B-5521",
  "body": "Lea cancelled within 24 hours and asks for a full refund."
}

A schedule starts the agent every Monday, and the report reaches your team as an HTML email.

Mondays at 08:00
Cron Scheduler
weekly-report
Report by email
cron-payload.json
{
  "trigger": "cron",
  "schedule": "0 8 * * 1",
  "triggered_at": "2026-10-12T08:00:00.000Z",
  "prompt": "Write the weekly support report"
}
output.json
{
  "to": ["lead@example.com", "ops@example.com"],
  "subject": "Support report, week 41",
  "body": "412 tickets, median first reply 38 minutes.",
  "html_body": "<h2>Week 41</h2><p>412 tickets, median first..."
}

Email (SMTP/IMAP) FAQ

Yes. Link the agent to an inbound Email connector and an outbound one. The reply goes to the sender unless the output sets to or the connector has a default recipient, and it reuses the original subject with Re: unless the output sets one. Plain text output becomes the body.

Yes. Turn on 2-factor authentication for the Google account, create an app password for Mail, and use it with imap.gmail.com or smtp.gmail.com in place of the account password.

Up to 10 supported attachments per email, with 10 MiB per file and 10 MiB combined: images, PDFs, text, CSV, Markdown, JSON, XML, HTML, and Word, Excel and PowerPoint files. Text formats arrive as text, the rest as base64. Tracking pixels and signature images are filtered out, and every other skipped file is listed in file_issues.

Yes, if they match the filters. With Unread Only on, which is the default, the first check picks up every unread message in the folder. Mark older mail as read or point the connector at a separate folder before you link the agent.

Yes. Set a Bridge on the connector, and connic sends its IMAP or SMTP traffic through the bridge running in your network.