# nodemailer-sendgrid-transport

> SendGrid transport for Nodemailer

Latest version **0.2.0** (published 2015-07-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install nodemailer-sendgrid-transport
pnpm add nodemailer-sendgrid-transport
yarn add nodemailer-sendgrid-transport
bun add nodemailer-sendgrid-transport
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2015-07-06 |
| First published | 2014-07-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | SendGrid |
| Maintainers | eddiezane, scottmotte, nquinlan, elbuo8, motdotla |
| Keywords | Nodemailer, SendGrid |

## Links

- npm: https://www.npmjs.com/package/nodemailer-sendgrid-transport
- Repository: https://github.com/sendgrid/nodemailer-sendgrid-transport
- Homepage: https://github.com/sendgrid/nodemailer-sendgrid-transport#readme
- Issues: https://github.com/sendgrid/nodemailer-sendgrid-transport/issues
- npm.io page: https://npm.io/package/nodemailer-sendgrid-transport

## Dependencies (1)

- [sendgrid](https://npm.io/package/sendgrid.md) ^1.8.0

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 0.2.0 (latest) — 2015-07-06
- 0.1.0 — 2014-10-17
- 0.0.2 — 2014-07-18
- 0.0.1 — 2014-07-17

## README

# nodemailer-sendgrid-transport

This module is a transport plugin for [Nodemailer](https://github.com/andris9/Nodemailer) that makes it possible to send through [SendGrid's Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html)!

[![BuildStatus](https://travis-ci.org/sendgrid/nodemailer-sendgrid-transport.svg?branch=master)](https://travis-ci.org/sendgrid/nodemailer-sendgrid-transport)
[![NPM version](https://badge.fury.io/js/nodemailer-sendgrid-transport.svg)](http://badge.fury.io/js/nodemailer-sendgrid-transport)

## Usage
Install via npm.

	npm install nodemailer-sendgrid-transport

Require the module and initialize it with your SendGrid credentials.

```javascript
var nodemailer = require('nodemailer');
var sgTransport = require('nodemailer-sendgrid-transport');

// api key https://sendgrid.com/docs/Classroom/Send/api_keys.html
var options = {
	auth: {
		api_key: 'SENDGRID_PASSWORD'
	}
}

// or

// username + password
var options = {
	auth: {
		api_user: 'SENDGRID_USERNAME',
		api_key: 'SENDGRID_PASSWORD'
	}
}
	
var mailer = nodemailer.createTransport(sgTransport(options));
```

Note: We suggest storing your SendGrid username and password as enviroment variables.

Create an email and send it off!

```javascript
var email = {
	to: ['joe@foo.com', 'mike@bar.com'],
	from: 'roger@tacos.com',
	subject: 'Hi there',
	text: 'Awesome sauce',
	html: '<b>Awesome sauce</b>'
};

mailer.sendMail(email, function(err, res) {
	if (err) { 
		console.log(err) 
	}
	console.log(res);
});
```
## License
Licensed under the MIT License.

---
_Source: https://npm.io/package/nodemailer-sendgrid-transport · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
