> ## Documentation Index
> Fetch the complete documentation index at: https://blaxel-pm-2441-firewall.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# AgentMail

> Use AgentMail with Blaxel to build an intelligent assistant that autonomously answers technical questions over email through agentic inboxes.

This example shows how to integrate agentic inbox provider [AgentMail](https://agentmail.to/) with Blaxel to create a customer success agent that autonomously handles technical questions via email (inbound and outbound).

## Requirements

To use this example, you'll need:

* the unique username for your AgentMail inbox
* an AgentMail API key

## Create an AgentMail inbox and API key

From your AgentMail dashboard, create a new inbox, providing a unique username (by default, the domain is set to `agentmail.to`):

<img src="https://mintcdn.com/blaxel-pm-2441-firewall/n_FpWx6Hg79EiWVw/Integrations/AgentMail/inbox.webp?fit=max&auto=format&n=n_FpWx6Hg79EiWVw&q=85&s=1741be57e3d07ddde79e155bed7c30f5" alt="inbox.webp" width="1650" height="581" data-path="Integrations/AgentMail/inbox.webp" />

From the same dashboard, obtain an API key:

<img src="https://mintcdn.com/blaxel-pm-2441-firewall/n_FpWx6Hg79EiWVw/Integrations/AgentMail/api.webp?fit=max&auto=format&n=n_FpWx6Hg79EiWVw&q=85&s=8ec1fec236840e920ba5b735d20767a4" alt="api.webp" width="574" height="319" data-path="Integrations/AgentMail/api.webp" />

## Configure the project

Clone the [example repository](https://github.com/blaxel-templates/template-agentmail-docbot) and follow the instructions provided.

Note that you must configure the following environment variables for your deployment:

```bash theme={null}
INBOX_USERNAME=      # a unique username for your inbox
AGENTMAIL_API_KEY=   # your AgentMail API key

```

Create a `.env` file in the project root with these variables, or set them in your deployment environment.

<Warning>
  The `AGENTMAIL_API_KEY` variable is required. If it is missing or not correctly set, the AgentMail client will fail to authenticate and return a **403 Forbidden** error at runtime. Confirm this variable is configured before deploying.
</Warning>

## Deploy the agent

[Deploy the agent](../Agents/Deploy-an-agent) on Blaxel. Once the agent is deployed, retrieve its [inference endpoint](../Agents/Query-agents).

<img src="https://mintcdn.com/blaxel-pm-2441-firewall/n_FpWx6Hg79EiWVw/Integrations/AgentMail/deployment.webp?fit=max&auto=format&n=n_FpWx6Hg79EiWVw&q=85&s=030322171f2a5d5463327b6d907aa805" alt="deployment.webp" width="768" height="193" data-path="Integrations/AgentMail/deployment.webp" />

You will need an API key to query the agent externally. Follow [this guide to create a service account in your workspace and generate an API key](../Security/Service-accounts).

<Card title="AgentMail Documentation" icon="book" href="https://docs.agentmail.to/welcome">
  Complete documentation for using AgentMail.
</Card>
