EmailTools enable an Agent to send an email to a user. The Agent can send an email to a user with a specific subject and body.

Example

cookbook/tools/email_tools.py
from agno.agent import Agent
from agno.tools.email import EmailTools

receiver_email = "<receiver_email>"
sender_email = "<sender_email>"
sender_name = "<sender_name>"
sender_passkey = "<sender_passkey>"

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 to <receiver_email>")

Toolkit Params

ParameterTypeDefaultDescription
receiver_emailOptional[str]NoneThe email address of the receiver.
sender_nameOptional[str]NoneThe name of the sender.
sender_emailOptional[str]NoneThe email address of the sender.
sender_passkeyOptional[str]NoneThe passkey for the sender’s email.
enable_email_userboolTrueEnable the email_user function.
allboolFalseEnable all available functions.

Toolkit Functions

FunctionDescription
email_userEmails 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