1
0
mirror of https://github.com/node-red/node-red-nodes.git synced 2023-10-10 13:36:58 +02:00
node-red-nodes/social/email
Dave Conway-Jones 0b590236a0
bump some node-red-node deps and packages
some due to  long outstanding doc PRs
2020-04-03 22:29:43 +01:00
..
locales add note re criteria to email in node 2020-01-28 18:15:28 +00:00
61-email.html add note re criteria to email in node 2020-01-28 18:15:28 +00:00
61-email.js Fix email node timeout when triggered manually 2020-02-09 14:11:54 +00:00
LICENSE Update licenses and packages for all nodes 2016-11-06 20:26:19 +00:00
package.json bump some node-red-node deps and packages 2020-04-03 22:29:43 +01:00
README.md Add gmail access info to readme and info 2019-08-29 15:49:38 +01:00

node-red-node-email

Node-RED nodes to send and receive simple emails.

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.

Note : Version 1.x of this node requires Node.js v8 or newer.

Install

Version 0.x of this node is usually installed by default by Node-RED. As long as you have at least version 0.19.x of Node-RED you can install the new version 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 an application password, or enable less secure access via your Google account settings.

Usage

Nodes to send and receive simple emails.

Input

Repeatedly gets 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.

Note: this node only gets the most recent single email from the inbox, so set the repeat (polling) time appropriately.

Uses the imap npm module.

Output

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 may optionally override the from email address by setting msg.from, otherwise the node will use the userid setting from the server connection.

The payload can be html format.

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 nodemailer format.

Uses the nodemailer npm module.