AWSSESTool enables an Agent to send emails using Amazon Simple Email Service (SES).

Prerequisites

The following example requires the boto3 library and valid AWS credentials. You can install boto3 via pip:

pip install boto3

You must also configure your AWS credentials so that the SDK can authenticate to SES. The easiest way is via the AWS CLI:

aws configure
# OR set environment variables manually
export AWS_ACCESS_KEY_ID=****
export AWS_SECRET_ACCESS_KEY=****
export AWS_DEFAULT_REGION=us-east-1

Make sure to add the domain or email address you want to send FROM (and, if still in sandbox mode, the TO address) to the verified emails in the SES Console.

Example

The following agent researches the latest AI news and then emails a summary via AWS SES:

aws_ses_tools.py
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.tools.aws_ses import AWSSESTool
from agno.tools.duckduckgo import DuckDuckGoTools

# Configure email settings
sender_email = "verified-sender@example.com"  # Your verified SES email
sender_name = "Sender Name"
region_name = "us-east-1"

agent = Agent(
    name="Research Newsletter Agent",
    model=OpenAIChat(id="gpt-4o"),
    tools=[
        AWSSESTool(
            sender_email=sender_email,
            sender_name=sender_name,
            region_name=region_name
        ),
        DuckDuckGoTools(),
    ],
    markdown=True,
    show_tool_calls=True,
    instructions=[
        "When given a prompt:",
        "1. Extract the recipient's complete email address (e.g. user@domain.com)",
        "2. Research the latest AI developments using DuckDuckGo",
        "3. Compose a concise, engaging email summarising 3 – 4 key developments",
        "4. Send the email using AWS SES via the send_email tool",
    ],
)

agent.print_response(
    "Research recent AI developments in healthcare and email the summary to johndoe@example.com"
)

Toolkit Params

ParameterTypeDefaultDescription
sender_emailstrNoneVerified SES sender address.
sender_namestrNoneDisplay name that appears to recipients.
region_namestr"us-east-1"AWS region where SES is provisioned.

Toolkit Functions

FunctionDescription
send_emailSend a plain-text email. Accepts the arguments: subject, body, receiver_email.

Developer Resources