A collection of AI SDK tools that give your AI agents the ability to send and manage emails using Resend.
npm install resend-ai-sdkSet the following environment variables:
RESEND_API_KEY="your_resend_api_key"
RESEND_EMAIL_DOMAIN="your_verified_domain.com"
Get your API key from the Resend Dashboard.
You'll also need to verify your domain to send emails.
import { generateText, stepCountIs } from "ai";
import { sendEmail, listTemplates, getTemplate } from "resend-ai-sdk";
const { text } = await generateText({
model: 'openai/gpt-5.2',
tools: { sendEmail, listTemplates, getTemplate },
prompt: "Find my welcome template and send it to user@example.com from hello@acme.com",
stopWhen: stepCountIs(5),
});| Tool | Description |
|---|---|
sendEmail |
Send an email with HTML, plain text, or a template |
sendBatchEmails |
Send multiple emails at once (up to 100) |
getEmail |
Retrieve the status and metadata of a sent email |
listEmails |
List recently sent emails |
listTemplates |
List available email templates with pagination |
getTemplate |
Retrieve a template's content, variables, and metadata |
createContact |
Add a new contact to your Resend account |
listContacts |
List contacts in your account |
removeContact |
Remove a contact permanently (requires approval) |
Find other AI SDK agents and tools in the AI SDK Library.
Contributions are welcome! Please read our Contributing Guide for more information.