V2 Node.js

The library does not officially support the V2 API, but you can use V2 with an older version of the library. For more information, see Continue Using V2 in Node.js.

Using SendGrid’s Node.js Library

1234567891011

// using SendGrid's Node.js Library// https://github.com/sendgrid/sendgrid-nodejsvarsendgrid=require("sendgrid")("SENDGRID_APIKEY");varemail=newsendgrid.Email();email.addTo("test@sendgrid.com");email.setFrom("you@youremail.com");email.setSubject("Sending with SendGrid is Fun");email.setHtml("and easy to do anywhere, even with Node.js");sendgrid.send(email);