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
- Documentation
- Email (SMTP/IMAP) docs
- 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.
{
"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.
[
{
"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.
type: email
mode: inbound
name: Support inbox
connection: support-mailbox
config:
mailbox: Support
agents:
- support-triage
environments:
Staging:
connection: support-mailbox-staging
Production: {}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.
{
"body": "Sorry about the lamp, Jana. A replacement ships today."
}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.
{
"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": []
}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.
{
"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"
}
]
}{
"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.
{
"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": []
}{
"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.
{
"trigger": "cron",
"schedule": "0 8 * * 1",
"triggered_at": "2026-10-12T08:00:00.000Z",
"prompt": "Write the weekly support report"
}{
"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
More connectors
AWS S3
Run an agent the moment a file lands in a bucket, with the file itself when you turn on Include Content.
Inbound
GitLab
Run an agent on issues, merge requests and comments in a GitLab project, on gitlab.com or your own instance. It replies with a comment.
Inbound · Outbound
Google Pub/Sub
Run an agent on every message a Pub/Sub push subscription delivers, checked with Google's signed token, and publish results to a topic.
Inbound · Outbound
Google Sheets
Run an agent on every new row in a spreadsheet and append its results as rows. connic signs in with your own service account.
Inbound · Outbound
Shopify
Run an agent when an order in your Shopify store is created, paid, fulfilled or cancelled. It tags the order or adds a note.
Inbound · Outbound
WebSocket
Stream tokens to the browser over a live socket. Build chat UIs that keep session state across turns.
Sync