Skip to content

nylas-samples/node-email-send

Repository files navigation

node-email-send

This sample will show you to easily send an email with the Nylas Node.js SDK.

Setup

System dependencies

  • Node.js v16.x

Gather environment variables

You'll need the following values:

ACCESS_TOKEN = ""
CLIENT_ID = ""
CLIENT_SECRET = ""
RECIPIENT_ADDRESS = ""

Add the above values to a new .env file:

$ touch .env # Then add your env variables

Install dependencies

$ npm i

Usage

Run the script using the node command:

$ node index.js

When your message is successfully sent, you'll get the following output in your terminal:

Message "With Love, from Nylas" was sent with ID 111111111111111111

Learn more

Visit our Nylas Node.js SDK documentation to learn more.