library · inferred from evidence
@sendgrid/mail
A library used for sending emails via SendGrid.
- SendGrid in a Next.js API route: server-only key, @sendgrid/mail
Send mail from a Next.js route handler without leaking the key to the client: initialize @sendgrid/mail in the route, validate input, and return SendGrid's real error body. Not for different error messages.
- Send email with SendGrid from Node.js (@sendgrid/mail v8)
The exact working pattern for @sendgrid/mail: setApiKey from the environment, a plain message object, and how to unwrap the response array and the error body when a send fails. Not the full reference manual.