How to call send email agent with input from research agent

Hi Team,

How can I make one agent to send input i.e email body crafted in research agent sent to another agent. as of now

“my research agent has :At the end summarize the analysis and recommendation in {email_body} and dispatch it to email_agent with {email_body}”

and task looks like

task.yaml
send_email_task:
description: “Task to send an email to {from_email} with {email_body}”
agent: “email_agent”
inputs:
sender_email: “sendder”
sender_password: “pass”
recipient_email: “email”
subject: “Log updates”
body: {email_body}

agent.yaml
email_agent:
role: “Log Sentinels”
goal: “An agent to send automated emails.”
backstory:
agent max_retries is set to 1 with timeout of 60 sec

In crew.yaml
@task
def send_email_task(self) → Task:
return Task(
config=self.tasks_config[‘send_email_task’],
output_file=‘recommendation.md’,
tools=[tool(‘send_email_tool’)]
)

I am getting following error
pydantic_core._pydantic_core.ValidationError: 3 validation errors for Agent
role
Field required [type=missing, input_value={‘verbose’: True}, input_type=dict]
For further information visit Redirecting...
goal
Field required [type=missing, input_value={‘verbose’: True}, input_type=dict]
For further information visit Redirecting...
backstory
Field required [type=missing, input_value={‘verbose’: True}, input_type=dict]

Please provide some pointer how can I solve this.

Best,
Priti

Task and agent YAML files only accept certain inputs -

You will need to create a custom tool that allows you to interact with SMTP I.E Gmail

You should check out flows - Flows - CrewAI

Also we have an email example here - crewAI-examples/email_auto_responder_flow at main · crewAIInc/crewAI-examples · GitHub