{"id":11445,"library":"node-red-node-email","title":"Node-RED Email Nodes","description":"node-red-node-email provides a set of nodes for the Node-RED visual programming environment, enabling users to easily send and receive emails within their flows. The current stable version is 5.2.3. The package offers an 'Email (input)' node to fetch messages from IMAP or POP3 servers, and an 'Email (output)' node to send emails via SMTP. It supports modern authentication methods such as OAuth2.0 for Exchange/Outlook 365 and application-specific passwords for Gmail, which are crucial for two-factor authentication setups. Releases are tied to Node.js version requirements, with recent versions requiring Node.js v20 or newer, and major updates often introducing breaking changes related to authentication mechanisms. Its primary differentiator is seamless integration into Node-RED, abstracting complex email protocols into configurable visual components, allowing for robust email automation directly within flows.","status":"active","version":"5.2.3","language":"javascript","source_language":"en","source_url":"https://github.com/node-red/node-red-nodes","tags":["javascript","node-red","email","gmail","imap","pop","smtp","smtp-server","mta"],"install":[{"cmd":"npm install node-red-node-email","lang":"bash","label":"npm"},{"cmd":"yarn add node-red-node-email","lang":"bash","label":"yarn"},{"cmd":"pnpm add node-red-node-email","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package provides nodes for the Node-RED environment; direct JavaScript module imports are not applicable. Nodes appear in the Node-RED editor palette after installation.","wrong":"import { EmailInputNode } from 'node-red-node-email';","symbol":"Email Input Node","correct":"Install 'node-red-node-email' via Node-RED's 'Manage Palette' or `npm i node-red-node-email` in your Node-RED user directory."},{"note":"Node-RED nodes are installed into the Node-RED runtime and configured visually, not through programmatic imports in user JavaScript files.","wrong":"const EmailOutputNode = require('node-red-node-email').output;","symbol":"Email Output Node","correct":"Install 'node-red-node-email' via Node-RED's 'Manage Palette' or `npm i node-red-node-email` in your Node-RED user directory."},{"note":"The 'email-mta' node saw a breaking change in v4 regarding password handling. Users must re-enter credentials after upgrading.","wrong":"import { EmailMtaNode } from 'node-red-node-email/mta';","symbol":"Email MTA Node","correct":"Install 'node-red-node-email' via Node-RED's 'Manage Palette' or `npm i node-red-node-email` in your Node-RED user directory."}],"quickstart":{"code":"// This JavaScript snippet demonstrates preparing an email message object\n// within a Node-RED Function node, which can then be wired to an\n// 'Email (output)' node for sending.\n\n// Set the email recipient\nmsg.to = \"recipient@example.com\";\n\n// Set the email subject\nmsg.topic = \"Automated Report from Node-RED\";\n\n// Set the email sender (may require valid credentials for the SMTP server)\nmsg.from = \"no-reply@yourdomain.com\";\n\n// Set the email body (plain text or HTML)\nmsg.payload = \"Hello,\\n\\nThis is an automated email report generated by Node-RED.\\n\\nRegards,\\nYour System\";\n\n// Optionally, add an HTML version of the body\n// msg.html = \"<h1>Automated Report</h1><p>Hello,</p><p>This is an <b>automated email report</b> generated by Node-RED.</p><p>Regards,<br/>Your System</p>\";\n\n// Optionally, add attachments (using Nodemailer format)\nmsg.attachments = [\n    {\n        filename: 'data.txt',\n        content: 'Content of the attached file, for example: Key=Value\\nStatus=OK',\n        contentType: 'text/plain'\n    }\n];\n\n// Return the modified message object for the next node in the flow\nreturn msg;\n","lang":"javascript","description":"This code prepares a message object (`msg`) within a Node-RED Function node, which the 'Email (output)' node then uses to send an email with a subject, body, sender, recipient, and optional attachments."},"warnings":[{"fix":"After upgrading to v4.x, reconfigure the user and password fields for `email-mta` nodes in your Node-RED flows.","message":"Version 4.x introduced a breaking change for the `email-mta` node. Users must re-enter any user/passwords for authenticating incoming mail due to a property clash.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Ensure your Node-RED environment is running on Node.js v20.0.0 or newer. Check Node-RED documentation for upgrading your Node.js version.","message":"Node.js version requirements have significantly increased. Version 3.x requires Node.js v18+, and the current 5.x series requires Node.js v20.0.0 or newer.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Visit your Google account settings to generate an application password or adjust 'less secure app access' settings as required for your GMail account.","message":"For GMail users, traditional password authentication is often insufficient. You will likely need to generate an application password or enable 'less secure app access' (though the latter is discouraged by Google).","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Register an application through the Microsoft platform and configure your `Email` node to use OAuth2.0, providing the necessary access tokens.","message":"For Exchange and Outlook 365, direct username/password authentication is often deprecated or requires specific configurations. OAuth2.0 is the recommended and often mandatory authentication method.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Ensure the email address provided in `msg.from` is valid and authorized by your SMTP server for sending emails through the configured account.","message":"The `msg.from` property, if set, might be ignored or result in '(No Sender)' if the email address is not a valid userid or an email address associated with the sending mail server's credentials.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"If using self-signed certificates, consult your SMTP server documentation or Nodemailer settings (if exposed by the node configuration) to allow insecure TLS connections, or obtain valid certificates.","message":"Sending emails with self-signed SSL/TLS certificates can cause Nodemailer (used internally by this package) to refuse sending the message.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"For Gmail, generate an App Password. For Outlook/Exchange, configure OAuth2.0. Double-check username and password entries in the node configuration.","cause":"Incorrect credentials, or modern email providers like Gmail/Outlook requiring application-specific passwords or OAuth2.0.","error":"Failed to connect: 535-5.7.8 Username and Password not accepted. Learn more at"},{"fix":"If safe to do so in your environment, try to find an option within the Email node configuration to disable SSL/TLS certificate verification, or install the server's certificate into your system's trust store.","cause":"The email server uses a self-signed or untrusted SSL/TLS certificate, and Nodemailer (used by the node) rejects it for security reasons.","error":"Error: self-signed certificate in certificate chain"},{"fix":"Verify the email server address and port in the node configuration. Ensure network connectivity from your Node-RED instance to the email server, and check firewall rules.","cause":"Network connectivity issues, incorrect server address, or firewall blocking the SMTP/IMAP/POP3 port.","error":"Error: ETIMEDOUT or ECONNREFUSED"},{"fix":"Set `msg.from` to an email address directly associated with the account used for authentication, or leave it blank to let the server use its default sender.","cause":"The configured mail server does not allow arbitrary `FROM` addresses or requires `msg.from` to match the authenticated user.","error":"(No Sender) appears in the sent email's 'From' field, or `msg.from` is not respected."}],"ecosystem":"npm"}