SendGrid's smtpapi library in NodeJS

License: MIT

Language: JavaScript

SendGrid Logo

BuildStatus npm Email Notifications Badge MIT licensed Twitter Follow GitHub contributors

This node module allows you to quickly and more easily generate SendGrid X-SMTPAPI headers.


NEW: If you're a software engineer who is passionate about #DeveloperExperience and/or #OpenSource, this is an incredible opportunity to join our #DX team as a Developer Experience Engineer and work with @thinkingserious and @aroach! Tell your friends :)

All updates to this module are documented in our CHANGELOG.

Table of Contents



  • Node.js version 0.10, 0.12 or 4
  • The SendGrid service, starting at the free level

Environment Variables

Update your environment with your SendGrid credentials. (if you will be sending via nodemailer or other SMTP transport)

echo "export SENDGRID_USERNAME='YOUR_USERNAME'" > sendgrid.env
echo "export SENDGRID_PASSWORD='YOUR_PASSWORD'" >> sendgrid.env
echo "sendgrid.env" >> .gitignore
source ./sendgrid.env

The following recommended installation requires npm. If you are unfamiliar with npm, see the npm docs. Npm comes installed with Node.js since node version 0.8.x therefore you likely already have it.

Install smtpapi-nodejs and its dependencies:

npm install smtpapi


Quick Start

var smtpapi   = require('smtpapi');
var header    = new smtpapi();
header.setUniqueArgs({cow: 'chicken'});



If you are interested in the future direction of this project, please take a look at our milestones. We would love to hear your feedback.

How to Contribute

We encourage contribution to our projects, please see our CONTRIBUTING guide for details.

Quick links:


smtpapi-nodejs is guided and supported by the SendGrid Developer Experience Team.

smtpapi-nodejs is maintained and funded by SendGrid, Inc. The names and logos for smtpapi-nodejs are trademarks of SendGrid, Inc.


The MIT License (MIT)

Project Statistics

Sourcerank 10
Repository Size 126 KB
Stars 37
Forks 42
Watchers 184
Open issues 23
Dependencies 6
Contributors 37
Tags 12
Last updated
Last pushed

Top Contributors See all

Mot Elmer Thomas Eddie Zaneski Wataru Sato Akram Rameez thepriefy Manjiri Tapaswi childish-sambino twilio-ci Shivam Agarwal Brandon West Nick Quinlan Eric Liu Jeff Gerlach Martin Gingras mell0kat SendGrid's DX Team Varayut Lerdkanlayanawat Robert Yamil Asusta

Packages Referencing this Repo

Build SendGrid X-SMTPAPI headers in nodejs.
Latest release 1.4.1 - Updated - 37 stars

Recent Tags See all

1.4.1 January 22, 2020
1.4.0 January 15, 2020
v1.3.1 April 11, 2017
v1.3.0 April 06, 2017
v1.2.0 July 19, 2015
v1.1.0 February 03, 2015
v1.0.4 October 25, 2014
v1.0.3 June 03, 2014
v1.0.2 May 28, 2014
v1.0.1 May 28, 2014
v0.0.2 April 16, 2014
v0.0.1 December 30, 2013

Something wrong with this page? Make a suggestion

Last synced: 2020-01-15 21:29:13 UTC

Login to resync this repository