Quickstart
This guide will walk you through installing the AgentMail SDK, authenticating with your API key, and creating your first email inbox.
Get your API Key
First, you’ll need an AgentMail API key. You can request one from the link below.
Once you have your key, create a .env
file in your project’s root
directory and add your key to it. We recommend using environment variables to
keep your keys secure.
Install the SDK
Install the AgentMail SDK using your preferred package manager. We’ll also
use a library to load the environment variable from the .env
file.
Create an inbox and send an email
Now you’re ready to make your first API call. Create a new file (e.g.,
quickstart.py
or quickstart.ts
) and add the following code. This script
will initialize the AgentMail client, create a new inbox, and then send a
test email.
The domain
parameter is optional. If not provided, AgentMail will
use the default @agentmail.to
domain. If you would like a custom domain, please email contact@agentmail.cc
Next Steps
Congrats, you sent your first email via AgentMail. But this isn’t our strength. Explore the full power of creating agents that can autonomously reply, take action, parse attachements, semantically search your inbox, by exploring our docs and tutorials below.
Looking for a different language? Email us at support@agentmail.cc and we’ll get you set up.