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

# Email

> Send email through Gmail SMTP with EmailTools.

`EmailTools` sends email through Gmail SMTP.

## Prerequisites

1. Enable [2-Step Verification](https://support.google.com/accounts/answer/185839) for the sender's Google Account.
2. Create a [Gmail app password](https://support.google.com/mail/answer/185833?hl=en).
3. Install Agno and the OpenAI client:

> [!NOTE]
>
> This example requires a Google Account that supports app passwords. Google may withhold app passwords from work, school, or organization accounts, security-key-only 2-Step Verification accounts, and accounts enrolled in Advanced Protection.

```shell theme={null}
uv pip install -U "agno[openai]"
```

Set the sender, receiver, app password, and model provider API key:

```bash Mac/Linux theme={null}
export RECEIVER_EMAIL="receiver@example.com"
export SENDER_EMAIL="sender@gmail.com"
export SENDER_NAME="Agno Agent"
export GMAIL_APP_PASSWORD="your_gmail_app_password"
export OPENAI_API_KEY="your_openai_api_key_here"
```

```powershell Windows theme={null}
$Env:RECEIVER_EMAIL="receiver@example.com"
$Env:SENDER_EMAIL="sender@gmail.com"
$Env:SENDER_NAME="Agno Agent"
$Env:GMAIL_APP_PASSWORD="your_gmail_app_password"
$Env:OPENAI_API_KEY="your_openai_api_key_here"
```

## Example

```python cookbook/91_tools/email_tools.py theme={null}
from os import getenv

from agno.agent import Agent
from agno.tools.email import EmailTools

receiver_email = getenv("RECEIVER_EMAIL")
sender_email = getenv("SENDER_EMAIL")
sender_name = getenv("SENDER_NAME")
sender_passkey = getenv("GMAIL_APP_PASSWORD")

agent = Agent(
    tools=[
        EmailTools(
            receiver_email=receiver_email,
            sender_email=sender_email,
            sender_name=sender_name,
            sender_passkey=sender_passkey,
        )
    ]
)

agent.print_response("Send an email confirming that the report is ready.")
```

## Toolkit Params

| Parameter | Type | Default | Description |
| - | - | - | - |
| `receiver_email` | `Optional[str]` | `None` | The email address of the receiver. |
| `sender_name` | `Optional[str]` | `None` | The name of the sender. |
| `sender_email` | `Optional[str]` | `None` | The email address of the sender. |
| `sender_passkey` | `Optional[str]` | `None` | The Gmail app password for the sender. |
| `enable_email_user` | `bool` | `True` | Enable the email\_user function. |
| `all` | `bool` | `False` | Enable all available functions. |

## Toolkit Functions

| Function | Description |
| - | - |
| `email_user` | Emails the user with the given subject and body. Parameters include `subject` (str) for the email subject and `body` (str) for the email content. Currently works with Gmail. Returns "email sent successfully" or error message. |

## Developer Resources

* [EmailTools source](https://github.com/agno-agi/agno/blob/v3.0.4/libs/agno/agno/tools/email.py)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.