> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blaxel.ai/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/OV8J20a-e6sNRxmO/Integrations/AgentMail/inbox.webp?fit=max&auto=format&n=OV8J20a-e6sNRxmO&q=85&s=6fc8a6068ab6a991182be995ca0cb968" 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/OV8J20a-e6sNRxmO/Integrations/AgentMail/api.webp?fit=max&auto=format&n=OV8J20a-e6sNRxmO&q=85&s=67b9ec7cf84bb4f6125762e143e914b1" 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/OV8J20a-e6sNRxmO/Integrations/AgentMail/deployment.webp?fit=max&auto=format&n=OV8J20a-e6sNRxmO&q=85&s=a29d34765ae15f25823bf8eabf86780e" 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>
