
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
node-red-contrib-email
Advanced tools
SMTP email node for Node-RED
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 install --save node-red-node-email
NodeJS version >= 6.0.0
Node-RED >= 2.0.0
msg.payload
will used as mail.text or mail.html, depending on content-type
field is set to text, html or amp.
Use the node form to define the fields or let the form fields empty and use msg.email
instead:
msg.email = {
from: "foo@example.com",
to: "bar@example.com",
subject: "Test",
text: "This is my mail",
attachments: [
{
// utf-8 string as an attachment
filename: "text1.txt",
content: "hello world!",
},
{
// binary buffer as an attachment
filename: "text2.txt",
content: new Buffer("hello world!", "utf-8"),
},
{
// file on disk as an attachment
filename: "text3.txt",
path: "/path/to/file.txt", // stream this file
},
{
// filename and content type is derived from path
path: "/path/to/file.txt",
},
{
// stream as an attachment
filename: "text4.txt",
content: fs.createReadStream("file.txt"),
},
{
// define custom content type for the attachment
filename: "text.bin",
content: "hello world!",
contentType: "text/plain",
},
{
// use URL as an attachment
filename: "license.txt",
path: "https://raw.github.com/nodemailer/nodemailer/master/LICENSE",
},
{
// encoded string as an attachment
filename: "text1.txt",
content: "aGVsbG8gd29ybGQh",
encoding: "base64",
},
{
// data uri as an attachment
path: "data:text/plain;base64,aGVsbG8gd29ybGQ=",
},
{
// use pregenerated MIME node
raw:
"Content-Type: text/plain\r\n" +
"Content-Disposition: attachment;\r\n" +
"\r\n" +
"Hello world!",
},
],
};
example for amp message
msg.email = {
from: "Nodemailer <example@nodemailer.com>",
to: "Nodemailer <example@nodemailer.com>",
subject: "AMP4EMAIL message",
text: "For clients with plaintext support only",
html: "<p>For clients that do not support AMP4EMAIL or amp content is not valid</p>",
amp: `<!doctype html>
<html ⚡4email>
<head>
<meta charset="utf-8">
<style amp4email-boilerplate>body{visibility:hidden}</style>
<script async src="https://cdn.ampproject.org/v0.js"></script>
<script async custom-element="amp-anim" src="https://cdn.ampproject.org/v0/amp-anim-0.1.js"></script>
</head>
<body>
<p>Image: <amp-img src="https://cldup.com/P0b1bUmEet.png" width="16" height="16"/></p>
<p>GIF (requires "amp-anim" script in header):<br/>
<amp-anim src="https://cldup.com/D72zpdwI-i.gif" width="500" height="350"/></p>
</body>
</html>`,
};
output msg.payload
includes the result, the exact format depends on the transport mechanism used
msg.payload.messageId
- most transports should return the final Message-Id value used with this propertymsg.payload.envelope
includes the envelope object for the messagemsg.payload.accepted
is an array returned by SMTP transports (includes recipient addresses that were accepted by the server)msg.payload.rejected
is an array returned by SMTP transports (includes recipient addresses that were rejected by the server)msg.payload.pending
is an array returned by Direct SMTP transport. Includes recipient addresses that were temporarily rejected together with the server response
response is a string returned by SMTP transports and includes the last SMTP response from the serverFAQs
SMTP email node for Node-RED
The npm package node-red-contrib-email receives a total of 106 weekly downloads. As such, node-red-contrib-email popularity was classified as not popular.
We found that node-red-contrib-email demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.