AgentMail is the fastest way to give a Replit agent its own email inbox. Your agent gets its own inbox, can send and receive email, and polls for replies.
The AgentMail SDK installs in one line on Replit. Add your API key to Replit Secrets and your agent has a real inbox.
agentmail
anthropic
python-dotenv# Tools -> Secrets -> Add secret
# Key: AGENTMAIL_API_KEY
# Value: am_us_your_key_hereReplit projects often use shared IPs that are rate-limited by email providers. AgentMail has its own dedicated infrastructure - your agent emails land in inboxes, not spam.
Store your API key in Replit Secrets, not your code. The AgentMail SDK reads from environment variables automatically.
Start from the official AgentMail Replit template. Fork it, add your API key, and have a working email agent running in under 5 minutes.
import os, time
from agentmail import AgentMail
from anthropic import Anthropic
client = AgentMail(api_key=os.getenv("AGENTMAIL_API_KEY"))
claude = Anthropic()
inbox = client.inboxes.create()
print(f"Agent inbox: {inbox.inbox_id}")
client.inboxes.messages.send(
inbox_id=inbox.inbox_id,
to="prospect@example.com",
subject="Quick question",
text="Hi - building something in the AI space and wanted to connect.",
)
while True:
time.sleep(30)
messages = client.inboxes.messages.list(inbox_id=inbox.inbox_id)
for msg in (messages.messages or []):
reply = claude.messages.create(
model="claude-haiku-4-5-20251001",
max_tokens=10,
messages=[{
"role": "user",
"content": f"Classify as INTERESTED / NOT_INTERESTED / OOO:\n{msg.text}"
}]
).content[0].text.strip()
print(f"{msg.from_address}: {reply}")Common questions about AgentMail and Replit.
Free tier. No credit card required. Inboxes ready in under a second.
Start for free© 2026 AgentMail, Inc. All rights reserved.