# node-red-node-email

> Node-RED nodes to send and receive simple emails.

Latest version **5.2.5** (published 2026-07-11) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install node-red-node-email
pnpm add node-red-node-email
yarn add node-red-node-email
bun add node-red-node-email
```

## Health

**Score 50/100 (C)** — status: active.

Positive: no vulnerabilities; high maintenance score.

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

## Facts

| | |
|---|---|
| Version | 5.2.5 |
| Published | 2026-07-11 |
| First published | 2015-06-15 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=20.0.0 |
| Dependencies | 6 |
| Unpacked size | 5.7 MB |
| Known vulnerabilities | 0 (+14 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1089 |
| Author | Dave Conway-Jones |
| Maintainers | knolleary, dceejay |
| Keywords | node-red, email, gmail, imap, pop, smtp, smtp-server, mta |

## Links

- npm: https://www.npmjs.com/package/node-red-node-email
- Repository: https://github.com/node-red/node-red-nodes
- Homepage: https://github.com/node-red/node-red-nodes#readme
- Issues: https://github.com/node-red/node-red-nodes/issues
- npm.io page: https://npm.io/package/node-red-node-email

## Dependencies (6)

- [imap](https://npm.io/package/imap.md) 0.8.19
- [semver](https://npm.io/package/semver.md) 5.7.2
- [node-pop3](https://npm.io/package/node-pop3.md) 0.11.0
- [mailparser](https://npm.io/package/mailparser.md) 3.9.14
- [nodemailer](https://npm.io/package/nodemailer.md) 9.0.3
- [smtp-server](https://npm.io/package/smtp-server.md) 3.19.2

## 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

- 5.2.5 (latest) — 2026-07-11
- 1.19.1-beta (beta) — 2023-03-21
- 5.2.4 — 2026-05-31
- 5.2.3 — 2026-04-17
- 5.2.2 — 2026-04-02
- 5.2.1 — 2026-02-26
- 5.2.0 — 2026-02-18
- 5.1.0 — 2026-01-15
- 5.0.5 — 2025-12-24
- 5.0.4 — 2025-12-24
- 5.0.2 — 2025-12-09
- 5.0.1 — 2025-11-30
- 5.0.0 — 2025-10-22
- 4.0.0 — 2025-08-26
- 3.1.0 — 2025-08-04
- … 90 more at https://npm.io/package/node-red-node-email/versions

## README

node-red-node-email
===================

<a href="http://nodered.org" target="info">Node-RED</a> nodes to send and receive simple emails.

**v6 Breaking Change**

The underlying nodemailer library has introduced a breaking change which by default enforces checking for valid TLS certs. This can be turned off per connection, but is opposite to the previous default.

Pre-requisite
-------------

You will need valid email credentials for your email server. For GMail this may mean
getting an application password if you have two-factor authentication enabled.

For Exchange and Outlook 365 you must use OAuth2.0.

Install
-------

You can install by using the `Menu - Manage Palette` option, or running the following command in your
Node-RED user directory - typically `~/.node-red`

        cd ~/.node-red
        npm i node-red-node-email

GMail users
-----------

If you are accessing GMail you may need to either enable <a target="_new" href="https://support.google.com/mail/answer/185833?hl=en">an application password</a>,
or enable <a target="_new" href="https://support.google.com/accounts/answer/6010255?hl=en">less secure access</a> via your Google account settings.</p>

Office 365 users
----------------

If you are accessing Exchange you will need to register an application through their platform and use OAuth2.0.
<a target="_new" href="https://learn.microsoft.com/en-us/exchange/client-developer/legacy-protocols/how-to-authenticate-an-imap-pop-smtp-application-by-using-oauth#get-an-access-token">Details on how to do this can be found here.</a>

Usage
-----

Nodes to send and receive simple emails.

### Input node

Fetches emails from an IMAP or POP3 server and forwards them onwards as messages if not already seen.

The subject is loaded into `msg.topic` and `msg.payload` is the plain text body.
If there is text/html then that is returned in `msg.html`. `msg.from` and
`msg.date` are also set if you need them.

Additionally `msg.header` contains the complete header object including
**to**, **cc** and other potentially useful properties.

Modern authentication through OAuth2.0 is supported, but must be triggered by an incoming access token and
can only be automatically triggered upstream.

### Output node

Sends the `msg.payload` as an email, with a subject of `msg.topic`.

The default message recipient can be configured in the node, if it is left blank it should be set using the `msg.to` property of the incoming message. You can also specify any or all of: `msg.cc`, `msg.bcc`, `msg.replyTo`, `msg.inReplyTo`, `msg.references`, `msg.headers`, or `msg.priority` properties.


The email *from* can be set using `msg.from` but not all mail services allow
this unless `msg.from` is also a valid userid or email address associated with
the password. Note: if `userid` or msg.from does not contain a valid email
address (userxx@some_domain.com), you may see *(No Sender)* in the email.

The payload can be html format. You can also specify `msg.plaintext` if the main payload is html.

If the payload is a binary buffer, then it will be converted to an attachment.

The filename should be set using `msg.filename`. Optionally
`msg.description` can be added for the body text.

Alternatively you may provide `msg.attachments` which should contain an array of one or
more attachments in <a href="https://nodemailer.com/message/attachments/" target="_new">nodemailer</a> format.

If required by your recipient you may also pass in a `msg.envelope` object, typically containing extra from and to properties.

If you have own signed certificates, Nodemailer can complain about that and refuse sending the message. In this case you can try switching off TLS.

Use secure connection - If enabled the connection will use TLS when connecting to server. If disabled then TLS is used if server supports the STARTTLS extension. In most cases set this to enabled if you are connecting to port 465. For port 587 or 25 keep it disabled.

This node uses the *nodemailer* npm module.

Testing
-----

You can pass the credentials object to the `node-red-node-test-helper` by doing the following:

```js
const emailNode = require("./61-email");

const testFlows = [{
    id: "n1", type: "e-mail", name: "Email",
    from: "email1test@example.com", subject: "TestSubject", server: "testServer",
    port: "1111", secure: "X", tls: true, authtype: "BASIC",
}];

const testCredentials = {
    n1: {
        userid: "ExampleUser",
        password: "ExamplePassword",
        global: false
    }
};

it('should be loaded', function (done) {
    helper.load(emailNode, testFlows, testCredentials, function () {
        const n1 = helper.getNode("n1");
        try {
            n1.should.have.property('name', 'Email');
            n1.should.have.property('from', 'email1test@example.com');
            n1.should.have.property('subject', 'TestSubject');
            n1.should.have.property('outserver', 'testServer'); // Gathered via server
            n1.should.have.property('outport', '1111'); // Gathered via port
            n1.should.have.property('secure', 'X');
            n1.should.have.property('tls', true);
            n1.should.have.property('authtype', 'BASIC');
            n1.should.have.property('credentials');
            n1.should.have.property('credentials', {
                userid: "ExampleUser",
                password: "ExamplePassword",
                global: false
            });
            done();
        } catch (err) {
            done(err);
        }
    });
});
```

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