Tools Reference

Communication

Send emails programmatically through your agents using the Resend email service.


email Premium

Send transactional emails via the Resend email API. Requires a configured Resend API key in the environment.

TypeScript
tools.email

Parameters

ParameterTypeRequiredDescription
tostringRecipient email address
subjectstringEmail subject line
bodystringEmail body content (text or HTML)
fromstringSender address (default: configured sender)

Returns

TypeScript
{
  success: true,
  messageId: "msg_abc123...",
  to: "user@example.com"
}

Example: Report Delivery Agent

An agent that generates a report and emails it:

TypeScript
const agent = createAgent({
  name: "Weekly Report Sender",
  systemPrompt: `Generate a weekly summary report from the provided data
    and email it to the specified recipient.`,
  tools: [
    tools.csvParse,       // Parse data
    tools.statistics,     // Analyze
    tools.markdownTable,  // Format
    tools.email,          // Send
  ],
});

The LLM will chain these tools: parse CSV → compute stats → format as a table → send via email.

Security Notes

  • Emails are sent from a verified domain — not arbitrary senders
  • Rate limits are enforced per agent and per user
  • Email content is sanitized to prevent injection
  • Users can see tool execution details including the email sent

The template_render tool in the Documents category is often paired with email to generate personalized email bodies from templates.


Next Steps