Skip to content
Back

Messaging via Resend: "to": "\"undisclosed-recipients\": ;" in request body

  • 0
  • Messaging
  • Web
  • Cloud
well-made
21 Oct, 2025, 07:08

I'm using the node-appwrite@18.0.0 SDK.

TypeScript
await messaging.createEmail({
        messageId: ID.unique(),
        subject: "Subject",
        content: `htmlContent`,
        users: [recipientUserId],
        draft: false,
        html: true,
      });

I can see in the console that this is received and the correct user is picked along with their default email target, but Resend always rejects this with status 422:

TypeScript
{
    "name": "validation_error",
    "message": "Invalid `to` field. The email address needs to follow the `email@example.com` or `Name <email@example.com>` format.",
    "statusCode": 422
}

In the request body, the bcc field is showing the actual correct email address, whereas the "to" field is showing a weird escaped phrase:

TypeScript
{
    "bcc": ["(this is correct)"],
    "to": "\"undisclosed-recipients\": ;"
}
TL;DR
The messaging createEmail function in Node.js using an SDK is encountering a "to" field validation error when attempting to resend emails. The issue is with the format of the "to" field, causing a status 422 rejection. The correct format for "to" should be "email@example.com" or "Name <email@example.com>". The request body currently shows an escaped phrase in the "to" field. Update the "to" field to the correct email format to resolve the issue.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more