Skip to main content
Glama

send_smtp_email

Send emails via SMTP using 'send_smtp_email' by specifying the recipient, subject, and HTML body for automated email delivery in Sitecore Send workflows.

Instructions

Send an email using SMTP

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bodyYesHTML body of the email
subjectYesSubject of the email
toYesEmail address to send the email to

Implementation Reference

  • The execute function implementing the tool logic: sends email using SMTP client with provided to, subject, body, and returns success/failure message.
    execute: async ({ to, subject, body }) => { const res = await client.sendMail({ from: config.from, to, subject, html: body, }); return { content: [{ type: "text", text: res.accepted.length > 0 ? "Email sent successfully." : "Email sending failed." }] } }
  • Input schema using Zod defining required parameters: to (email), subject, body (HTML).
    parameters: z.object({ to: z.string().email().describe("Email address to send the email to"), subject: z.string().describe("Subject of the email"), body: z.string().describe("HTML body of the email"), }),
  • src/tools/smtp.ts:6-37 (registration)
    The addSmptTools function that validates config, creates SMTP client, and registers the 'send_smtp_email' tool on the FastMCP server.
    export const addSmptTools: (server: FastMCP, config: SmtpConfig) => void = (server, config) => { if (!validateSmtpConfig(config)) { console.error("SMTP configuration is invalid. Please check your environment variables."); return false; } const client = createClient(config); server.addTool({ name: "send_smtp_email", description: "Send an email using SMTP", parameters: z.object({ to: z.string().email().describe("Email address to send the email to"), subject: z.string().describe("Subject of the email"), body: z.string().describe("HTML body of the email"), }), annotations: { title: "Send SMTP Email", openWorldHint: true, }, execute: async ({ to, subject, body }) => { const res = await client.sendMail({ from: config.from, to, subject, html: body, }); return { content: [{ type: "text", text: res.accepted.length > 0 ? "Email sent successfully." : "Email sending failed." }] } } }); return true; }
  • Helper function to create Nodemailer SMTP transport client from configuration.
    export const createClient = (smtpConfig: SmtpConfig) => nodemailer.createTransport({ host: smtpConfig.host, port: smtpConfig.port, secure: smtpConfig.secure, auth: { user: smtpConfig.auth.user, pass: smtpConfig.auth.pass } });

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/izharikov/send-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server