client.mail. This module allows you to send emails using your project’s configured mail provider (e.g. Resend).
send
Send an email.SendMailPayload)
Returns (
SendMailResponse)
Example
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Send transactional emails from your server using the SDK mail module.
client.mail. This module allows you to send emails using your project’s configured mail provider (e.g. Resend).
sk_live_...). This module should only be used in server-side environments (Node.js, Edge Functions, etc.). Never call these methods from a browser.send(payload: SendMailPayload): Promise<SendMailResponse>
SendMailPayload)
| Field | Type | Required | Description |
|---|---|---|---|
to | string | string[] | Yes | Recipient email address(es). |
subject | string | Yes | Email subject line. |
text | string | No | Plain text body. |
html | string | No | HTML body. |
SendMailResponse)
| Field | Type | Description |
|---|---|---|
id | string | null | The message ID from the provider (null if unavailable). |
provider | "byok" | "default" | The provider used for sending. |
monthlyUsage | number | Total emails sent this month. |
monthlyLimit | number | Your project’s monthly quota. |
const response = await client.mail.send({
to: 'customer@example.com',
subject: 'Welcome to urBackend',
html: '<h1>Hi there!</h1><p>Thanks for joining.</p>'
});
console.log(response.id);
Was this page helpful?
