IMAP & SMTP
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.
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.
imaplib or smtplib) in any programming languageBefore configuring IMAP or SMTP, you’ll need two pieces of information from the AgentMail Console:
Use IMAP to read emails from your AgentMail inbox.
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.
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.
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.
Use SMTP to send emails from your AgentMail inbox.
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.
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.