| layout | page | ||
|---|---|---|---|
| weight | 0 | ||
| title | Node.js | ||
| navigation |
|
{% github sendgrid/sendgrid-nodejs#usage Node.js %} We recommend using SendGrid Node.js, our client library, available on Github, with full documentation. {% endgithub %}
{% anchor h2 %} using SendGrid's Node.js Library {% endanchor %} {% codeblock lang:js %} // using SendGrid's Node.js Library - https://github.com/sendgrid/sendgrid-nodejs var sendgrid = require("sendgrid")(api_user, api_key); var email = new sendgrid.Email();
email.addTo("[email protected]"); email.setFrom("[email protected]"); email.setSubject("Sending with SendGrid is Fun"); email.setHtml("and easy to do anywhere, even with Node.js");
sendgrid.send(email); {% endcodeblock %}