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 phi.agent import Agent
from phi.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_emailstr-The email address of the receiver.
sender_namestr-The name of the sender.
sender_emailstr-The email address of the sender.
sender_passkeystr-The passkey for the sender’s email.

Toolkit Functions

FunctionDescription
email_userEmails the user with the given subject and body. Currently works with Gmail.