Learn how to send your first email using AWS Lambda.
const RESEND_API_KEY = 're_xxxxxxxxx'; export const handler = async (event) => { const res = await fetch('https://api.resend.com/emails', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${RESEND_API_KEY}`, }, body: JSON.stringify({ from: 'Acme <onboarding@resend.dev>', to: ['delivered@resend.dev'], subject: 'hello world', html: '<strong>it works!</strong>', }), }); if (res.ok) { const data = await res.json(); return { statusCode: 200, body: data, }; } };
Deploy
Test
Was this page helpful?