Skip to content

Specify recipients

Specify multiple recipients, CC and BCC, and named addresses when sending with Email Service.

Email Service lets you specify recipients in several ways — multiple recipients, CC and BCC, and named addresses — using the Workers binding, the REST API, or SMTP. The combined number of addresses across to, cc, and bcc must not exceed 50. See Limits.

Multiple recipients

TypeScript
const response = await env.EMAIL.send({
to: ["user1@example.com", "user2@example.com", "user3@example.com"],
from: { email: "newsletter@yourdomain.com", name: "Newsletter Team" },
subject: "Monthly Newsletter",
html: "<h1>This month's updates</h1>",
text: "This month's updates",
});

CC and BCC

TypeScript
const response = await env.EMAIL.send({
to: "customer@example.com",
cc: ["manager@example.com"],
bcc: ["archive@example.com"],
from: "orders@yourdomain.com",
replyTo: "support@yourdomain.com",
subject: "Order Confirmation #12345",
html: "<h1>Your order is confirmed</h1>",
text: "Your order is confirmed",
});

Named recipients

Provide a display name alongside the address for the sender and recipients.

TypeScript
const response = await env.EMAIL.send({
to: { email: "jane@example.com", name: "Jane Doe" },
from: { email: "support@yourdomain.com", name: "Support Team" },
subject: "Welcome!",
html: "<h1>Thanks for joining!</h1>",
text: "Thanks for joining!",
});

Mixed plain and named recipients

Combine plain addresses and named addresses in the same to field.

TypeScript
const response = await env.EMAIL.send({
to: ["plain@example.com", { email: "jane@example.com", name: "Jane Doe" }],
from: "support@yourdomain.com",
subject: "Team update",
html: "<h1>Monthly update</h1>",
text: "Monthly update",
});

Next steps