Skip to main content
The send() method dispatches a single email through your SES infrastructure. It returns a messageId on success.

Basic usage

import { WrapsEmail } from '@wraps.dev/email';

const email = new WrapsEmail({ region: 'us-east-1' });

const result = await email.send({
  from: '[email protected]',
  to: '[email protected]',
  subject: 'Welcome!',
  html: '<h1>Hello from Wraps!</h1>',
});

console.log('Sent:', result.messageId);

Examples

await email.send({
  from: '[email protected]',
  to: '[email protected]',
  subject: 'Welcome!',
  html: '<h1>Hello from Wraps!</h1>',
});

Parameters

from
string
required
Sender email address. Must be a domain or address verified in SES. Use the format '[email protected]' or 'Your App <[email protected]>'.
to
string | string[]
required
Recipient email address or array of addresses.
subject
string
required
Email subject line.
html
string
HTML body content. Provide html, text, or react — at least one is required.
text
string
Plain text body content. Recommended alongside html for email clients that do not render HTML.
react
ReactElement
A React Email component. The SDK renders it to HTML before sending. Requires react and @react-email/render to be installed in your project.
attachments
object[]
File attachments to include.
replyTo
string
Reply-to email address. Defaults to the from address if not set.
cc
string | string[]
CC recipient email address or array of addresses.
bcc
string | string[]
BCC recipient email address or array of addresses.

Return value

send() returns a promise that resolves to:
messageId
string
The SES message ID assigned to the sent email. Use this for tracking and debugging.

Notes

The from address must belong to a domain verified in SES. Run wraps email domains verify -d yourdomain.com to check verification status.
If your SES account is in sandbox mode, you can only send to verified email addresses. Request production access in the AWS console to send to any recipient.

Build docs developers (and LLMs) love