IMAP & SMTP
IMAP & SMTP
AgentMail supports standard IMAP and SMTP protocols, allowing you to connect using traditional email clients or integrate with existing systems that rely on these protocols.
What are IMAP and SMTP?
IMAP (Internet Message Access Protocol) and SMTP (Simple Mail Transfer Protocol) are the standard protocols that power email communication across the internet.
-
IMAP is used to read and manage emails. It allows email clients to sync with a mail server, keeping your messages organized across multiple devices. When you check your inbox in Outlook or Thunderbird, you’re using IMAP.
-
SMTP is used to send emails. When you hit “Send” on an email, SMTP handles delivering that message to the recipient’s mail server.
Why Use IMAP/SMTP with AgentMail?
- Email Client Integration: Connect Outlook, Thunderbird, Apple Mail, or any IMAP/SMTP-compatible client to your AgentMail inbox
- Programmatic Access: Send and receive emails using standard libraries (like Python’s
imapliborsmtplib) in any programming language - Legacy System Integration: Bridge AgentMail with existing systems that only support IMAP/SMTP protocols
- Familiar Tooling: Use email tools you already know during development and testing
Finding Your Credentials
Before configuring IMAP or SMTP, you’ll need two pieces of information from the AgentMail Console:
IMAP Configuration
Use IMAP to read emails from your AgentMail inbox.
SSL/TLS Required
SSL/TLS is required for all IMAP connections. Connections without SSL will be rejected. Make sure to enable SSL/TLS in your email client settings.
Folder Support
IMAP exposes the following folders: INBOX, Sent, Trash, and Spam. A Drafts folder is also listed for client compatibility but always appears empty — use the AgentMail API to create and manage drafts.
Real-time updates with IDLE
The IMAP server supports the IDLE extension (RFC 2177), so modern
clients (Thunderbird, Outlook, Apple Mail) receive new messages
push-style without polling. Clients negotiate IDLE automatically when
supported — no extra configuration needed.
Python IMAP Example
TypeScript IMAP Example
SMTP Configuration
Use SMTP to send emails from your AgentMail inbox.
Encryption Required
Encryption is required for all SMTP connections. Connect using port 465
with implicit TLS (SSL on connect) or port 587 with STARTTLS (upgrade
in-band). On port 587, attempting to authenticate before issuing STARTTLS
is rejected with a 538 error.
From Address
The “From” address in your email should match the email address of your inbox
(e.g., myinbox@agentmail.to). Using a different From address may result in
delivery failures.
SMTP Limits
- Max recipients: 50 per email
- Max message size: 10MB
- Session timeout: 30 minutes
