{"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.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install node-red-node-email"],"cli":null},"imports":["Install 'node-red-node-email' via Node-RED's 'Manage Palette' or `npm i node-red-node-email` in your Node-RED user directory.","Install 'node-red-node-email' via Node-RED's 'Manage Palette' or `npm i node-red-node-email` in your Node-RED user directory.","Install 'node-red-node-email' via Node-RED's 'Manage Palette' or `npm i node-red-node-email` in your Node-RED user directory."],"auth":{"required":false,"env_vars":[]},"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.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}